Thursday, April 17, 2008

Check Out-Of-Office Status in Outlook using VBA

Extract Out of Office Status using Outlook VBA

Checking out of office status using VBA can be done using PropertyAccessor. The following code uses PropertyAccessor to extract the information

Unlike NamedProperties, PropertyAccessor uses Schema to get the property

Sub Check_Out_Of_Office()

Dim oNS As Outlook.NameSpace
Dim oStores As Outlook.Stores
Dim oStr As Outlook.Store
Dim oPrp As Outlook.PropertyAccessor

Set oNS = Application.GetNamespace("MAPI")
Set oStores = oNS.Stores
For Each oStr In oStores
If oStr.ExchangeStoreType = olPrimaryExchangeMailbox Then
Set oPrp = oStr.PropertyAccessor
MsgBox oPrp.GetProperty("")

End If

End Sub

The PropertyPage object is an abstract object. That is, the PropertyPage object in the Microsoft Outlook Object Library contains no implementation code. Instead, it is provided as a template to help you implement the object in Microsoft Visual Basic. This provides a predefined set of interfaces that Outlook can use to determine whether your custom property page has changed and to notify your program that the user has clicked the Apply or OK button. (If your custom property page does not rely on the Apply button, then you do not need to implement the PropertyPage object.)

A custom property page is an ActiveX control that is displayed by Outlook in the Options dialog box or in the folder Properties dialog box when the user clicks on the custom property page’s tab.


  1. How can the OutOfOffice setting be changed using this method?

    Can the OutOfOffice setting be read/set without using schema?

  2. Interesting, however, is there any when to detect the event of OOA being set. I'm a fire warden at work and want to send an automated message to the other wardens when I'm going to be out of the office.

  3. Anonymous5:54 AM

    Is there any way to check the the OOO status/text of another exchange email account?


Share on Facebook
Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.