Delete Custom Menu Question in Word

B

badboy

I add a custom menu in word by COM add-in using vc++. I remove the custom
menu in method OnBeginShutdown in interface _IDTExtensibility2, and
Unregister the COM add_in, but when I startup word again, the menu still
exists. How can I remove the menu.
 
C

Cindy M -WordMVP-

Hi Badboy,
I add a custom menu in word by COM add-in using vc++. I remove the custom
menu in method OnBeginShutdown in interface _IDTExtensibility2, and
Unregister the COM add_in, but when I startup word again, the menu still
exists. How can I remove the menu.
the problem is that you MUST specify CustomizationContext when creating and
when deleting commandbars and their elements (menus, buttons, etc.) If you
don't, Word guesses, and almost always guesses differently when creating
and deleting. Customization Context can be a document object, it's attached
template, the NormalTemplate or any other global template (Templates
collection).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi Badboy,
Thanks. But How can I do it? How can I use CustomizationContext ?
Have you read up on the property in the Word object model's Help
files? All you have to do is assign the desired "container" to the
property. The same one immediately before creating and deleting the
commandbar stuff.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
Top