Syntax
MenuText$(Type, MenuNumber [, Context])
Remarks
Returns the name of a shortcut menu or a menu on the menu bar. If there is an underlined letter in the menu name, MenuText$() includes an ampersand (&) before the letter in the returned text. (On the Macintosh, the underlined letters in menu and command names appear only in menu mode.)
Argument | Explanation | |
Type | The type of menu: 0 (zero) Menus on the menu bar when a document is open 1 Menus on the menu bar when no document is open 2 Shortcut menus | |
MenuNumber | A number in the range 1 to CountMenus() for the specified type. If Type is 0 (zero) or 1, MenuNumber represents a position on the menu bar from left to right (where 1 corresponds to the File menu). If Type is 2, MenuNumber represents a position in the series of shortcut menus in the Change What Menu box on the Menus tab in the Customize dialog box (Tools menu): The first shortcut menu in the series is 1, the second is 2, and so on. | |
Context | Specifies the template that contains the name of menu MenuNumber you want to return: 0 (zero) or omitted Normal template 1 Active template |
Example
This example defines an array to fill with the names of the shortcut menus available in the Normal template and then fills the array:
size = CountMenus(2, 0) - 1 Dim shortcutMenus$(size) For count = 0 To size shortcutMenus$(count) = MenuText$(2, count + 1, 0) Next count
See Also
CountMenuItems(), CountMenus(), MenuItemMacro$(), MenuItemText$(), ToolsCustomizeMenus