mekafe
mekafe

Reputation: 616

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.

Upvotes: 1

Views: 1827

Answers (1)

Axel Kemper
Axel Kemper

Reputation: 11324

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.

Upvotes: 3

Related Questions