Outlook VBA外出-设置日期和格式

时间:2018-10-08 13:27:13

标签: vba outlook outlook-2013

我正在使用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

有人知道吗?任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

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