I have an outlook addin I'm writing in VSTO. I want to exit the addin in a certain case. System.Application.Windows.Forms.Exit() exits outlook completely. I just want the addin to shutdown. I can't call ThisAddIn_Shutdown() because it is private. What is the correct practice to shut the addin down? This addin doesn't continuously run, it only calls a routine when a button is pressed. I want to stop execution if the current item is not a mail item, but I'm not sure what method to call or the correct way to handle it. I don't see any examples on MSDN either.
Asked
Active
Viewed 163 times
1 Answers
1
I just want the addin to shutdown.... it only calls a routine when a button is pressed.
Simply disable the button (grey it out) and stop any running background processes. Any addin which disappears would become circumspect that it is failing out to the user which is not the impression one should give.

ΩmegaMan
- 29,542
- 12
- 100
- 122
-
how can you disable/grey out the button? – ss7 May 10 '15 at 06:35
-
@shenk set its `Enabled` property to false. – ΩmegaMan May 10 '15 at 14:55