![](/img/trans.png)
[英]MS-Word-VBA UserForm - How to run a macro from a command button to a specific location inside the document?
[英]How to Set Outlook in Work Offline Mode by VBA(Macro) Running From MS Word VBA UserForm
我正在嘗試運行一個 VBA 代碼,它應該讓用戶將文件附加到郵件合並功能中。
為了做到這一點,我需要將 Outlook 置於離線模式,以便在將任何文件附加到郵件之前將郵件保存在發件箱中。 現在我想知道是否有一種方法可以通過 Word 宏將 Outlook 2007 置於脫機模式?
首先,添加對 Outlook 對象庫的引用。 如果 Outlook 已經打開:
Outlook.ActiveExplorer().CommandBars.FindControl(, 5613).Execute
如果 Outlook 已關閉:
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
olApp.GetNamespace("MAPI").Folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613).Execute
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.