protected virtual void OnShutdown ();
To run code just before the add-in is unloaded, add code to the
ThisAddIn_Shutdown method in the
ThisAddIn class. This method is a default event handler for the Shutdown event. For more information, see Events in Office Projects. For more information about the
ThisAddIn class, see Programming VSTO Add-Ins.