MikeWorkflow
2005-06-07 19:27:01 UTC
I'm having difficulty removing a commandbarbutton from the standard toolbar,
that was created by my addin.
In my research, before adding a button, it appears you should set the
Application.CustomizationContext property. What helped a little was setting
this property to Application.ActiveDocument.
Upon doing this, the button would create upon load and delete when the
application closed, ONLY IF YOU LAUNCHED OFFICE WITHOUT OPENING A DOCUMENT
(such as just clicking the Microsoft Word 2003 shortcut). However, if you
open up a document (for instance, double clicking on a Word doc), my button
no longer deletes when Word closes.
What I'm guessing is the Application.ActiveDocument object value that I am
setting when creating the button upon startup no longer exists once the
application goes to shut down and remove the button, thus orphaning the
button.
It's imperative that this button goes away after use so that when the add in
is uninstalled, I don't have a broken useless button sitting on my toolbar.
Any ideas?
Thanks.
that was created by my addin.
In my research, before adding a button, it appears you should set the
Application.CustomizationContext property. What helped a little was setting
this property to Application.ActiveDocument.
Upon doing this, the button would create upon load and delete when the
application closed, ONLY IF YOU LAUNCHED OFFICE WITHOUT OPENING A DOCUMENT
(such as just clicking the Microsoft Word 2003 shortcut). However, if you
open up a document (for instance, double clicking on a Word doc), my button
no longer deletes when Word closes.
What I'm guessing is the Application.ActiveDocument object value that I am
setting when creating the button upon startup no longer exists once the
application goes to shut down and remove the button, thus orphaning the
button.
It's imperative that this button goes away after use so that when the add in
is uninstalled, I don't have a broken useless button sitting on my toolbar.
Any ideas?
Thanks.