Getting the Outlook Out of Office Flag Using .NET

My company uses Exchange 2003.

Can I request an exchange with .NET code to see if the Out of Office Assistant is on or off?

+3
source share
1 answer

Using the Outlook Redemption library , you can obtain the Out of Office status as follows:

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 the status of another user, you need to get MAPIOBJECTfor your mailbox.

+2
source

Source: https://habr.com/ru/post/1715614/


All Articles