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

    Question

  • 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!"
    
       objSIM.Save
    
       Exit For
    
      End If
    
     Next
    
     
    
     Set objSre = Nothing
    
     Set objPAC = Nothing
    
     Set objSIM = Nothing
    
    


    Tuesday, July 05, 2011 12:36 PM

Answers

  • So do you see more than one IPM.Note.Rules.OofTemplate.Microsoft message?

    Go to the Inbox, click IMAPIFolder on the OutlookSpy toolbar/ribbon, go to the "Associated Contents" tab.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Thursday, July 07, 2011 8:36 PM

All replies

  • Can you quantify "doesn't always come up"?

    Can you see it after restarting Outlook? Do you end up with two IPM.Note.Rules.OofTemplate.Microsoft messages (you can check with OutlookSpy or MFCMAPI)?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been

    Wednesday, July 06, 2011 2:57 PM
  • The OOO is always enabled! But the text doesn't always show...mostly the textbox is blanc (without text)
    Thursday, July 07, 2011 12:58 PM
  • So do you see more than one IPM.Note.Rules.OofTemplate.Microsoft message?

    Go to the Inbox, click IMAPIFolder on the OutlookSpy toolbar/ribbon, go to the "Associated Contents" tab.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Thursday, July 07, 2011 8:36 PM