Get Outlook Out of Office status using C#

Last post 05-25-2008 6:13 AM by fayaz_3e. 0 replies.

Sort Posts:

  • Get Outlook Out of Office status using C#

    05-25-2008, 6:13 AM
    • Loading...
    • fayaz_3e
    • Joined on 09-14-2007, 6:15 AM
    • Chennai
    • Posts 15
    Hi,

    I am working in a web application where i am sending mails to employees. I have to send mails to persons whose outlook out of office is set to false. And I need to know one's out of office status. For that I used the following code. By using this I am getting my outlook out of office status. But how can I get other employees Out of office staus? My code is

    OutLook.NameSpace oNS;
    OutLook.Stores oStores;
    //OutLook.Store oStr;
    OutLook.PropertyAccessor oPrp;

    OutLook._Application outlookObj = new OutLook.Application();

    oNS = outlookObj.GetNamespace("MAPI");
    oStores = oNS.Stores;


    foreach(OutLook.Store oStr in oStores)
    {
    if(oStr.ExchangeStoreType == Microsoft.Office.Interop.Outlook.OlExchangeStoreTy pe.olPrimaryExchangeMailbox)
    {
    oPrp = oStr.PropertyAccessor;
    bool OutOfOffice = (bool) oPrp.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x661D000B");
    }
    }
    Filed under: ,
Page 1 of 1 (1 items)
Microsoft Communities
Page view counter