I have windows application which enables user log-in. After Login I want the Add-in get loaded. and when user Exits that paticular Word instance(Only one instance of word can exists when the login application runs) then add-in is also unloaded. I have tried to do it by
addin.Connect = false;//Application.COMAddins. Connect
It sets the LoadBehaviour( COM add-ins list) to 2
and when it loads i set it to 3
Its working but MSword displays so many error messages while exit and sometimes disables my add-in.
Is there any other way to load and unload add-in dynamically?
In add-in’s StartUp event i checked the the property of login form. if it is set then execute following line
and added a quit event handler
in its App_Quit method
Now when i quit word; my add-in is unloaded. finally it started working 🙂