Joost Verdaasdonk
Posts: 41
Joined: 2007-05-25
|
Hi,
My Word add-in is used with load on demand.
This means my users have a word .dot file with a button to load and unload the add-in.
The following problem is presented:
* if the user loads the add-in and closes Word the menu-items and commandbars of the add-in are still there. (idle of course it's not loaded anymore)
* if the user uses the button to unload the add-in (by setting connect property to false) then all menu customizations are unloaded properly.
What would be the best way to correctly unload my Word add-in in a manner that behaves the same way as closing it by button?
I'm thinking of using some unloading command that would mimmic setting the connect property to false in the following Word Event:
adxWordEvents_Quit
However I have no idea which code I should put in there.
Any advice would be much appreciated.Regards,
ManualMaster Development |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Joost.
1. You can use temporary command bars or just remove controls in the AddinBeginShutdown event handler when Word is shutting down. Also you can use the Word Document Module wizard to add a document-specific module to the add-in (see the WordFax example from the Add-in Express installation package).
2. I this case Add-in Express removes all controls in the AddinFinalize event handler.
The following example removes controls from Outlook. But you can implement the same technique for Word too.
http://www.add-in-express.com/projects/adxinstallevents2.zip
P.S. We always do our best to answer your forum requests as soon as possible. However, we apply the rule "first in first out" with Premium Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found.
|
|
Joost Verdaasdonk
Posts: 41
Joined: 2007-05-25
|
Hi Sergey,
Thank you for your answer. However I wasn't to clear.
Our code allready uses temporary controls and that works fine.
So to be more clear. If we unload the addin by a click of a button. (application.comaddins(progid).connect=false) then all menu's and buttons are automaticaly removed.
But if the add-in is running and the user exits the application. (with the query close button) then some of the controls remain. (the menu buttons and they are set to temporary in the interface)
So basicly if you use the button to unload the app all is fine but if you just exit the app then the menu buttons remain.
So it seams to me the add-in isn't unloaded properly in that manner. (Closing the app) Must be a disposing issue.
FYI we're using Load on Demand.
Youre thoughs? Regards,
ManualMaster Development |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Joost, sometimes Word stores custom command bars in the Normal.dot template regardless whether they are temporary or not. Please try to use our Word Document module. The module automatically disables its command bars when an appropriate document is unloaded. |
|
Joost Verdaasdonk
Posts: 41
Joined: 2007-05-25
|
Hi Sergey,
Thanks I'll do some tests with it to see how it works out with the controls.Regards,
ManualMaster Development |
|