今天看啥  ›  专栏  ›  完美Excel

将用户窗体保存为PDF

完美Excel  · 公众号  · Excel  · 2024-05-22 12:51
学习Excel技术,关注微信公众号:excelperfect标签:VBA,用户窗体在网上看到的一段程序,能够将用户窗体保存为PDF文件,特辑录于此,供查阅或方便有兴趣的朋友参考。首先,插入一个标准模块,输入下面的代码:Private Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate 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 _ E ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照