Getting the Outlook Out of Office flag with .NET

▼魔方 西西 提交于 2019-12-03 17:08:54

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!