文章预览
学习Excel技术,关注微信公众号: excelperfect 标签: VBA , 用户窗体 在网上看到的一段程序,能够将用户窗体保存为 PDF 文件,特辑录于此,供查阅或方便有兴趣的朋友参考。 首先,插入一个标准模块,输入下面的代码: Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare PtrSafe Function _ GetActiveWindow & Lib "user32" () Private Declare PtrSafe Sub GetWindowRect Lib _ "user32" (ByVal hwnd & , lpRect As RECT) Private Declare PtrSafe Function _ GetDesktopWindow & Lib "user32" () '剪贴板操作 Private Declare PtrSafe Function _ OpenClipboard & Lib "user32" (ByVal hwnd & ) Private Declare PtrSafe Function _ CloseClipboard & Lib "user32" () Private Declare PtrSafe Function SetClipboardData & _ Lib "user32" (ByVal wFormat & , ByVal hMem & ) Private Declare PtrSafe Function
………………………………