
Add an item to MenuBar on newDocument
Hi Peter,
Quote:
> i want to add an item to the Word-Menubar on document_new,
> but only when this item is not present at the time, and i
> want to assign a vba-makro to this item. By the way, it
> should be named as i want it.
You need to familiarize yourself with the COMMANDBARS
collection and related topics. You need to
1) Loop through all controls in "Menu bar" CommandBar and
check their captions (to find out if it's already there)
2) Use Commandbars("Menu bar").control.Add if it's not
3) Be sure to set an object variable when you do "add"
4) With this object variable, you need to address the
control's commandbar property in order to add addtional,
pop-up buttons: o_ctl.commandbar.controls.add and be sure to
assign these to object variables, so that you can set their
properties
5) The .OnAction propety assigns a macro; .Caption assigns a
"name"
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)