I'm working on a VSTO Outlook 2007 add-in that basically synchronizes Outlook data with web service. There are three types of synchronization that I want to have in the app: startup sync, manual sync and sync on shutdown. The first two as simple and are already done.
However I have problems finding an appropriate event to fire to handle my sync on shutdown. I tried hooking to the following two events but it seems that they are fired too late when add-in doesn't have access to Outlook data and this just doesn't work:
((Outlook.ApplicationEvents_Event)Application).Quit
(this one fires first, but it's already too late to access Outlook data collections and update them)ThisAddIn.Shutdown
(this one fires afterQuit
so it's not good as well)
Are there any other events that are fired before those ones on Outlook shutdown that I could use? Or maybe someone knows any other way to handle sync-on-shutdown in Outlook add-in?