Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Application_Quit()
- OutOfOffice True
- End Sub
- Private Sub Application_Startup()
- OutOfOffice False
- End Sub
- Sub OutOfOffice(bolState As Boolean)
- 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
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement