Out Of Office (Office 2007/2010 - Exchange Server 2003/2007/2010)


  • I would like to have some code that enable's the OOO including the body text. The code must work for Office 2007 en 2010 with Exchange Servers 2003/2007/2010. With the code below the OOO is always turned on, but the text doesn't always come up. I now use Office 2007/2010 with Exchange Server 2003.
     Dim objSre As Store
     Dim objPAC As PropertyAccessor
     Dim objSIM As StorageItem
     For Each objSre In Session.Stores
      If objSre.ExchangeStoreType = olPrimaryExchangeMailbox Then
       Set objPAC = objSre.PropertyAccessor
       objPAC.SetProperty PR_OOF_STATE, True
       Set objSIM = Outlook.Session.GetDefaultFolder(olFolderInbox).GetStorage("IPM.Note.Rules.OofTemplate.Microsoft", olIdentifyByMessageClass)
       objSIM.Body = "Hellow World!"
       Exit For
      End If
     Set objSre = Nothing
     Set objPAC = Nothing
     Set objSIM = Nothing

    Tuesday, July 05, 2011 12:36 PM


All replies