How to Unload an Outlook Plug-In?

Add-in Express™ Support Service
That's what is more important than anything else

How to Unload an Outlook Plug-In?
How to shutdown or unload an Add-In Express plugin from Outlook 
Stephen Braich




Posts: 6
Joined: 2010-08-09
I have been tasked with figuring out how to kill our Add-In Express Outlook Plug-in on a fatal error without killing Outlook.

I tried ADXModule1.Finalize(). It does get rid of any forms that are displayed but not the Ribbon command bar. If my plug-in throws an exception and it is a fatal error, I want to completely unload the plug-in.

Steve
Posted 24 Aug, 2010 18:49:43 Top
Alexander Solomenko




Posts: 140
Joined: 2009-02-27
Hi Stephen,

Unfortunately, it is impossible to kill the plug-in without unloading the Outlook.
The only way is to find out where the error occurs and to fix it.
First try to get rid of the error by disabling all the events used by your add-in.
If that doesn't work, please send us your test project to replicate the issue.
Regards,
Aleksandr Solomenko
Posted 26 Aug, 2010 06:23:04 Top
Stephen Braich




Posts: 6
Joined: 2010-08-09
It appears you can close and dispose of forms that you load. Is there a way to restart and reinitialize the plug-in programmatically? I mean if I determine I have a fatal error. I can disable(close, dispose, finalize) all of my Plug-In objects, how can I restart my plug-in (programmatically) without the user having to restart outlook?

Steve
Posted 26 Aug, 2010 15:53:00 Top
Alexander Solomenko




Posts: 140
Joined: 2009-02-27
Hi Stephen,

Depending on its logic every Addin can introduce some changes to the work of Outlook process.
When an unknown error occurs these changes need a rollback but it is impossible in this case without restating Outlook.
If you still want to disable the plug-in you can try to do this using OutlookApp.COMAddIns.Item(<IndexYourPlugIn>).Connect = false
Regards,
Aleksandr Solomenko
Posted 27 Aug, 2010 07:15:49 Top