【发布时间】:2019-03-13 04:35:58
【问题描述】:
我正在使用 Outlook 2013,需要帮助使用 VBA 激活 Out Of Office。我无法设置开始和结束时间以及格式化我的消息。我似乎无法使用html标签... 还有办法获取我当前的签名吗?
到目前为止的代码:
Sub absence(toggle As Boolean)
Const PR_OOF_STATE = "http://schemas.microsoft.com/mapi/proptag/0x661D000B"
Dim oStore As Outlook.Store, oProp As Outlook.PropertyAccessor
Dim oStorageItem As Outlook.StorageItem
Set oStorageItem = Application.Session.GetDefaultFolder(olFolderInbox).GetStorage("IPM.Note.Rules.OofTemplate.Microsoft", olIdentifyByMessageClass)
oStorageItem.Body = "<html><body><b>I am curerntly not available...</b></body></html>"
oStorageItem.Save
For Each oStore In Session.Stores
If oStore.ExchangeStoreType = olPrimaryExchangeMailbox Then
Set oProp = oStore.PropertyAccessor
oProp.SetProperty PR_OOF_STATE, toggle 'If true: start OOF, if false: quit OOF
End If
Next
Set olkIS = Nothing
Set olkPA = Nothing
End Sub
有人有想法吗?任何帮助表示赞赏。
【问题讨论】:
-
什么不起作用?错误代码是什么?
-
当前代码工作正常,但我想仅在特定日期之间激活外出。另外我想格式化正文...
-
在我看来,您不使用谷歌搜索但想要一个无错误的测试代码作为回报。我做了谷歌,找到了你问题的答案。这不是免费的编程服务。你需要自己采取行动来解决你所追求的。
-
你能告诉我你在哪里找到的吗?我花了几个小时寻找,但没有发现任何有用的东西。
-
我刚刚使用了您的关键字。Google 更胜一筹
标签: vba outlook outlook-2013