none
Check when Outlook has completed initial sync RRS feed

  • Question

  • Creating an Outlook 2010 add-in, really struggling to find a reliable method of waiting for Outlook to finish downloading all mail from the sync that occurs on startup. I've tried using the SyncEnd event on the All Accounts SyncObject, but the only time that doesn't seem to fire is for that initial Send/Receive. I noticed that going to the properties of the Inbox folder, that there's a "Last synchronized on" statistic, but I am unable to access this value programmatically. I also tried to see if I could programmatically get the status bar text to wait for it to say "All folders are up to date." but it seems that it isn't possible to access the status bar from an Outlook add-in. Does anyone have an idea on how I can have a reliable method of waiting for all mail to come in from that initial send/receive?

    Thanks

    Tuesday, January 6, 2015 11:59 AM

Answers

  • The Outlook object model doesn't provide any other event for that. The SyncEnd event is exactly what you need I think. Here is what MSDN states for the event:

    Occurs immediately after Microsoft Outlook finishes synchronizing a user’s folders using the specified Send/Receive group.

    What code do you use for subscribing to the event?

    P.S. As for the Status Bar, you can try to use Accessibility Api for reading a value. There is no trivial way.


    • Edited by Eugene Astafiev Tuesday, January 6, 2015 1:03 PM
    • Marked as answer by IvanBrazza Wednesday, January 7, 2015 9:52 AM
    Tuesday, January 6, 2015 12:30 PM

All replies

  • The Outlook object model doesn't provide any other event for that. The SyncEnd event is exactly what you need I think. Here is what MSDN states for the event:

    Occurs immediately after Microsoft Outlook finishes synchronizing a user’s folders using the specified Send/Receive group.

    What code do you use for subscribing to the event?

    P.S. As for the Status Bar, you can try to use Accessibility Api for reading a value. There is no trivial way.


    • Edited by Eugene Astafiev Tuesday, January 6, 2015 1:03 PM
    • Marked as answer by IvanBrazza Wednesday, January 7, 2015 9:52 AM
    Tuesday, January 6, 2015 12:30 PM
  • The SyncEnd event didn't seem to trigger when that initial synchronization completed for some reason (maybe I was subscribing too late, but I added the event listener in the startup code, so it couldn't get any earlier).

    However, I've now used UI Automation to read the value of the Synchronization Status label in the status bar, and am using that to check when the sync is complete. Thanks for your help!

    Tuesday, January 6, 2015 4:30 PM