展望VBA外出 - 设置日期+格式(Outlook VBA Out of Office - Sett

2019-10-28 11:58发布

IM使用Outlook 2013和需要帮助激活外出用VBA。 我有麻烦设置开始和结束时间,以及格式化我的消息。 我似乎不能够使用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

任何人有一个想法? 任何帮助表示赞赏。

Answer 1:

HTML OOF答复和时间范围,只能使用EWS设置-请参阅MSDN上SetUserOofSettings操作( https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/setuseroofsettings-operation )



文章来源: Outlook VBA Out of Office - Setting a Date + Formatting