|
https://4sysops.com/archives/automate-out-of-office-messages-in-outlook-with-visual-basic-for-applications-vba/
so wie ich das verstanden habe, erstellt man die regel für die autorespondernachricht und dann schaltet man das ein. Mir schein dieses Makro erledigt das.
Sub OutOfOffice(bolState As Boolean)
'Calling this with a state of True enables out of office and calling it with a state of False disables out of office
On Error GoTo eh
Const PR_OOF_STATE = "http://schemas.microsoft.com/mapi/proptag/0x661D000B"
Dim olkIS As Outlook.Store, olkPA As Outlook.PropertyAccessor
For Each olkIS In Session.Stores
If olkIS.ExchangeStoreType = olPrimaryExchangeMailbox Then
Set olkPA = olkIS.PropertyAccessor
olkPA.SetProperty PR_OOF_STATE, bolState
End If
Next
Set olkIS = Nothing
Set olkPA = Nothing
Exit Sub
eh:
MsgBox "The following error occurred: " & Err.Description
End Sub
|