outlook-addinoutlook-2010shutdown

Outlook Add In Outlook ShutDown Event


I am working on Outlook Add-In project. Is there any event or something that Outlook has been shut down?I need to call a service method just before outlook has been closed.


Solution

  • Yes, you can make use of the Quit event of the Application object.

    The Quit event is fired when Outlook begins to close.

    C# example:

    ((Outlook.ApplicationEvents_11_Event)Application).Quit 
    += new Outlook.ApplicationEvents_11_QuitEventHandler(ThisAddIn_Quit);
    
    void ThisAddIn_Quit()
    {
       MessageBox.Show("Ciao!");
    }
    

    Copied from here.

    Note:
    There are some additional hints for Shutdown for Outlook 2010 Add-In developers here.