Deleting a Word CommandBar

  • Thread starter Michael Tissington
  • Start date
M

Michael Tissington

I have an add-in C++ which adds an item to the Word menu.

In the OnBeginShutDown event I delete the item that I added, in fact I see
it disappear when I run under debug.

However when I start Word back up it is still there.

How do I permanently delete the item that I added ?

Thanks.

Michael Tissington
 
Z

zen35111

Hi Michael

Have you tried setting the 'Temporary' parameter to VARIANT_TRUE when
you call _CommandBars Add method?

I find that this removes the need to call Delete on disconnection or
shutdown.

Regards

Steve H
 
C

Cindy M.

Hi Michael,
I have an add-in C++ which adds an item to the Word menu.

In the OnBeginShutDown event I delete the item that I added, in fact I see
it disappear when I run under debug.

However when I start Word back up it is still there.

How do I permanently delete the item that I added ?
When manipulating CommandBars and anything on them in Word you MUST
explicitly set the Application.CustomizationContext in every "scope".
Otherwise, you've added things to one "container" (usually the Normal.dot
template) and then end up removing them from a different one (usually the
ActiveDocument or its AttachedTemplate).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
M

Michael Tissington

Thanks Cindy

Cindy M. said:
Hi Michael,

When manipulating CommandBars and anything on them in Word you MUST
explicitly set the Application.CustomizationContext in every "scope".
Otherwise, you've added things to one "container" (usually the Normal.dot
template) and then end up removing them from a different one (usually the
ActiveDocument or its AttachedTemplate).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top