Add an item to MenuBar on newDocument 
Author Message
 Add an item to MenuBar on newDocument

Hello,
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.
I've tried different ways, but nothing will do.
Please help me!
Peter


Fri, 19 Nov 2004 22:36:34 GMT  
 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 :-)



Sat, 20 Nov 2004 16:38:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MenuBar Control extra menu item appearing

2. eVB Menubar -- Single item

3. add a menu separation bar to a custom menubar

4. adding a menubar to a userform

5. Programatically Add Button To Menubar

6. Can you add these controls to the menubar?

7. How to add Icon/Pics to menubar

8. Adding a menubar to a coolbar (VB6)

9. adding to menubar

10. add items and removing items from a list

11. Adding Menu item to the Mail item menu from an outlook Addin

12. Adding Menu item to the Mail item menu from an outlook Addin

 

 
Powered by phpBB® Forum Software