4

My company is using Exchange 2003.

Is it possible to query exchange from .NET code to find out if someone's 'Out of Office' assisstant is on or off?

Kirschstein
  • 14,570
  • 14
  • 61
  • 79

1 Answers1

3

Using the Outlook Redemption library, you can get Out of Office status like this:

public bool IsOutOfOffice()
{
    var outlook = new Microsoft.Office.Interop.Outlook.Application();
    var rdoSession = new Redemption.RDOSession();
    rdoSession.MAPIOBJECT = outlook.Session.MAPIOBJECT;

    Redemption.RDOOutOfOfficeAssistant OOFA = 
        (_rdoSession.Stores.DefaultStore as Redemption.RDOExchangeMailboxStore).OutOfOfficeAssistant

    return OOFA.OutOfOffice;
}

To check another user's status, you need to get the MAPIOBJECT for their mailbox.

Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86