Out-of-office automaticly set for Outlook 2010 for inside & outside organisation

0

I am currently able to automatically enable OOO (out-of-office) automatically when Outlook is closed.

I have the following code which enables OOO when I close outlook, it currently works only for internal emails (replying to emails received from inside the organisation), but it doesnt work for emails received outside the organisation (like if I send an email from my hotmail account to test it, I get no automated reply).

Any ideas on how to fix this?

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

Thank you very much for any help you can provide...

Olga p.s. original source: http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/A_3487-Automating-Out-of-Office-in-Outlook.html

Lucinda

Posted 2014-10-20T11:23:41.673

Reputation: 1

Yep, verified what you are seeing. For some reason the code does not enable "Auto-reply to people outside my organization" check-box when it runs. I have not found the code to enable that yet. – CharlieRB – 2014-10-20T13:12:31.433

Any luck finding a solution? Thanks a lot for looking into it! – Lucinda – 2014-10-21T08:05:01.013

I've found lots of articles and posts with this same code, and comments or questions how to overcome the same issue, but no answers how to do it. Unfortunately, I have not been able to find the VBA object to change that particular check-box to true. Sorry. – CharlieRB – 2014-10-21T11:26:52.380

No worries, thank you! Maybe its a bug and only Microsoft know the solution... – Lucinda – 2014-10-22T07:53:41.070

No answers