Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Private Sub Application_Quit()
  2. OutOfOffice True
  3. End Sub
  4.  
  5. Private Sub Application_Startup()
  6. OutOfOffice False
  7. End Sub
  8.  
  9. Sub OutOfOffice(bolState As Boolean)
  10. Const PR_OOF_STATE = "http://schemas.microsoft.com/mapi/proptag/0x661D000B"
  11. Dim olkIS As Outlook.Store, olkPA As Outlook.PropertyAccessor
  12. For Each olkIS In Session.Stores
  13. If olkIS.ExchangeStoreType = olPrimaryExchangeMailbox Then
  14. Set olkPA = olkIS.PropertyAccessor
  15. olkPA.SetProperty PR_OOF_STATE, bolState
  16. End If
  17. Next
  18. Set olkIS = Nothing
  19. Set olkPA = Nothing
  20. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement