In my add-in for Outlook, I have the following lines.
private void ThisAddIn_Startup(object sender, System.EventArgs e) { MessageBox.Show("Hazaa!"); } private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { MessageBox.Show("Shazoo..."); }
While Outlook greets me cool "Haza!" from the very beginning, he refuses to go βSahzu ...β to me when I close it. Both methods are registered in the same way using the automatically generated code by default, so I donβt suspect any errors. Another explanation, about which I can think of is that the closing process is executed when the application has already left the GUI and shazooing is hidden.
This is true? If not, how can I make Outlook shazoo me? If so, how can I notify the user visually about such a shazoo?
EDIT:
Apparently, since O10, shutdown ceases to be called, so the automatically generated code below really wrong (or at least not perfect). Courtesy of @ Christian.K.
#region VSTO generated code private void InternalStartup() { this.Startup += new System.EventHandler(ThisAddIn_Startup); this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); } #endregion
source share