PrintToolsCustomizeMenuBar

Syntax

ToolsCustomizeMenuBar [.Context = number] [, .Position = number] [, .MenuType = number] [, .MenuText = text] [, .Menu = text] [, .Add] [, .Remove] [, .Rename]

Remarks

Adds, removes, or renames menus on the menu bar. Arguments for the ToolsCustomizeMenuBar statement correspond to options in the Menu Bar dialog box (Menus tab, Customize command, Tools menu).

Argument

Explanation

.Context

Determines where the menu change is stored:

0 (zero) or omitted Normal template

1 Active template

.Position

Specifies where to add a new menu: 0 (zero) corresponds to the first (leftmost) position, 1 to the second, and so on. To add a menu to the rightmost position, set .Position to –1.

.MenuType

Specifies which menu bar to change:

0 or omitted The menu bar when a document is open

1 The menu bar when no document is open

.MenuText

A new name for the menu; used with .Add and .Rename. Place an ampersand (&) in front of the access key, if any. Note that a menu bar can have only one menu of a given name (irrespective of ampersands).

.Menu

The name of the menu you want to change; used with .Rename and .Remove. Including an ampersand (&) before the access key in the menu name is optional (for example, you can specify either "File" or "&File").

.Add

Adds the menu specified by .MenuText to the menu bar.

.Remove

Removes the specified menu.

.Rename

Renames the specified menu.


If you do not specify .Add, .Remove, or .Rename, Word adds the menu.

To reset menu bars, use the .ResetAll argument with ToolsCustomizeMenus. Note that this resets all menu assignments to their defaults.

Example

This example adds a new menu named Macros to the right of the Help menu (Windows) or Window menu (Macintosh):


ToolsCustomizeMenuBar .MenuText = "&Macros", .Add, .Position = -1

See Also

ToolsCustomizeMenus