View Single Post
  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default Weird movement of floating menus

Hi Noel,

If I want this present on all toolbars, do I need to add the
title/header to all instances of the macros?

You mean, if you want a button to run this macro from all
toolbars? Yes, you'd need to drag it from
Tools/Customize/Commands to each toolbar.

Or, you could use a macro to make the change. Here's a bit of
sample code that could do that (but note that I'm not testing
it myself, because I don't have a button I want to add to
every toolbar). However, you may find it adds the command in
unexpected places...

So, before starting Word, make a copy of your Normal.dot
template and put it somewhere safe. Then if you don't like the
result you can always revert back to your original state
without too much pain :-)

Remember to check the things in "quotes" and change them to
match your system.

Sub AddButtonToAllBars()
Dim cBar as Office.CommandBar
Dim cButton as Office.CommandBarButton

CustomizationContext = NormalTemplate
For each cb in Application.CommandBars
Set cButton = cBar.Controls.Add(msoControlButton)
cButton.OnAction = "Macro name"
cButton.Caption = "Lock toolbar"
Next
End Sub

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 :-)