Get Outlook Out of Office status using C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fayazmd
    New Member
    • Jul 2007
    • 41

    Get Outlook Out of Office status using C#

    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

    Code:
     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.OlExchangeStoreType.olPrimaryExchangeMailbox)
                {
                    oPrp = oStr.PropertyAccessor;
                    bool OutOfOffice = (bool) oPrp.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x661D000B");                                
                }
            }
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Unless you are able to provide their credentials to login, I am not sure you can do that.

    Why not send emails to all of them have something in place to intercept the "out of office" auto-reply and ignore it?

    Comment

    • fayazmd
      New Member
      • Jul 2007
      • 41

      #3
      Hi Plater,

      We have microsoft office communicator. If any body, sets out of office, it gets reflected in communicator. How this is possible, if credentilas are required to know the status.

      Originally posted by Plater
      Unless you are able to provide their credentials to login, I am not sure you can do that.

      Why not send emails to all of them have something in place to intercept the "out of office" auto-reply and ignore it?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well there is bound to be a like "administra tor" credential into the communicator system that can view all the statuses.
        I am unfamiliar with communicator and that whole setup thought.

        Comment

        • fayazmd
          New Member
          • Jul 2007
          • 41

          #5
          Any way Thanks for try!

          Originally posted by Plater
          Well there is bound to be a like "administra tor" credential into the communicator system that can view all the statuses.
          I am unfamiliar with communicator and that whole setup thought.

          Comment

          Working...