Outlook VBA外出-设置日期和格式 [英] Outlook VBA Out of Office - Setting a Date + Formatting
本文介绍了Outlook VBA外出-设置日期和格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Outlook 2013,并且需要使用VBA激活外出时的帮助.我在设置开始时间和结束时间以及格式化消息方面遇到麻烦.我似乎无法使用html标签... 还有获取我当前签名的方法吗?
im using Outlook 2013 and need help activating Out Of Office with VBA. I have trouble setting a starting and endtime as well as formatting my message. I seem not to be able to use html tags... Is there also a way of getting my current signature?
到目前为止的代码:
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
有人知道吗?任何帮助表示赞赏.
Anyone got an idea? Any help appreciated.
推荐答案
只能使用EWS设置HTML OOF答复和时间范围-请参阅MSDN上的SetUserOofSettings操作(
HTML OOF replies and time ranges can only be set using EWS - see SetUserOofSettings operation on MSDN (https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/setuseroofsettings-operation)
这篇关于Outlook VBA外出-设置日期和格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文