How to shutdown the add-in by code

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

How to shutdown the add-in by code
 
Thomas Grossen


Guest


Hi,

Can you tell me a way to shutdown or disable the add-in from itself by code? For example when a trial period expired, I need to stop the add-in. :)

Thank you.

Thomas

Posted 27 Mar, 2006 04:19:21 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

You just need to delete the following key in the system registry:

For the Current user:
HKEY_CURRENT_USER\Software\Microsoft\Office\<Host App>\Addins\<Add-in ProgID>

For everyone:
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\<Host App>\Addins\<Add-in ProgID>

In this case an add-in will not be loaded next time.
Posted 27 Mar, 2006 12:20:45 Top
Thomas Grossen


Guest


Ok, but this is not what I mean.

I want the add-in to continue to load each time Outlook is started, but in the initialisation of the add-in, I would like to be able to stop it, in certain case. Is this possible?

Thank you,

Thomas.
Posted 27 Mar, 2006 13:34:16 Top
Matt Driver


Matt


Posts: 152
Joined: 2004-08-17
I do the following:

On Add-in startup I test various registry keys and objects, if they are all present I let the add-in continue to load, I set a variable called AddinActive = TRUE. If any are failures I set the variable AddinActive to false. At the same time I set the visible and enabled properties of my explorer and inspector objects to true or false depending on the above test.

On the Inspector and Explorer activate events I then test the variable AddinActive and if = false I exit otherwise I perform my code etc.

When this is disabled you do not see the addin load and is totally transparent to the user.

Hope this helps

Matt
Posted 27 Mar, 2006 16:05:32 Top
Thomas Grossen


Guest


Hi Matt,

Thank you for your input.

I was looking for a easier solution that will avoid to test "AddinActive" on all explorer / inspectors,

But if there is no other solution, I will use yours.

Thank you again.

Thomas.
Posted 28 Mar, 2006 03:26:49 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

I agree with Matt. This is a good solution.
Posted 28 Mar, 2006 10:24:10 Top
Thomas Grossen


Guest


Ok. Thank you both.

Thomas.
Posted 28 Mar, 2006 10:30:40 Top