Word: CommandBars.Item("Text")

S

SunSet

Hello togehther,
i want to add a new Popup to the Contextmenue in Word (Right click on
the textbody) which all is included in an AddIn. To add a new button
works fine with these piece of code:

oCommandBars = applicationObject.CommandBars
KontextMenu =
oCommandBars("Text").Controls.Add(MsoControlType.msoControlPopup, , , ,
True)
KontextMenu.BeginGroup = True
With KontextMenu
.Tag = "Textartwählen"
.Caption = "Textartwählen"
End With

KontextMenu1 =
KontextMenu.Controls.Add(MsoControlType.msoControlButton, , , , True)
With KontextMenu1
.Caption = "Textart1"
.FaceId = 63
.Tag = "Textart1"
.OnAction = "!<CataloX.Connect>"
.Visible = True
End With

But...
with theses piece of code i try to reset the commandbar. And that
didn't work.

oCommandBars = applicationObject.CommandBars
oCommandBars.Item("Text").Reset()

Everytime i open the Document a new menu ("Textartwählen") with a
button ("Textart1") is added to the contextmenue (CommandBars("Text")).


Someone there who had an idea what i do wrong ?

Sincerly,

Bernd
 

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