none
How to get the Outlook connection mode for IMAP account? RRS feed

  • Question

  • Hello,

    In my adding, I need to retrieve the connection status for outlook. I've been reading MSDN documentation and I found that Account.ExchangeConnectionMode property, could help me with this point.

    But, as I've seen, this seems to work only for Exchange accounts. In my case, we use an IMAP server. 

    Is there a way to natively retrieve the connection state? We are also planning to ping our server in order to know if outlook is connected. 

    All help is highly appreciated. Thanks a lot!

    Regards,

       Yolanda

    Monday, March 17, 2014 2:42 PM

Answers

  • Outlook provides no means to verify the IMAP4 connection status. the best you can do is (using Extended MAPI) figure out if "Work Offline" was clicked.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Yolanda SDF Monday, March 17, 2014 2:49 PM
    Monday, March 17, 2014 2:46 PM
  • Hello Yolanda,

    The Outlook object model doesn't provide any property or method for this. However, you can use Windows API functions for checking whether an internet connection is available and etc.


    Monday, March 17, 2014 2:46 PM

All replies

  • Outlook provides no means to verify the IMAP4 connection status. the best you can do is (using Extended MAPI) figure out if "Work Offline" was clicked.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Yolanda SDF Monday, March 17, 2014 2:49 PM
    Monday, March 17, 2014 2:46 PM
  • Hello Yolanda,

    The Outlook object model doesn't provide any property or method for this. However, you can use Windows API functions for checking whether an internet connection is available and etc.


    Monday, March 17, 2014 2:46 PM
  • Thanks Dimitry,

    So the ping idea combined with OlExchangeConnectionMode. olOffline is the most plausible solution to retrieve the connection status.

    Regards,

       Yolanda

    Monday, March 17, 2014 2:49 PM
  • Dimitry,

    I forgot about this option. 

    Thanks to both of you! combining these ideas I'll achieve my goal.

    Monday, March 17, 2014 2:51 PM
  • You are welcome, Yolanda!
    Monday, March 17, 2014 8:34 PM
  • I do not think Namespace.ExchangeConnectionMode will give you a meaningful result for an IMAP4 store - you will get back 0 (olNoExchange).

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, March 17, 2014 9:18 PM