Gets or sets the shortcut key text displayed next to a CommandBarButton control when the button appears on a menu, submenu, or shortcut menu. Read/write.

Note
The use of CommandBars in some Microsoft Office applications has been superseded by the new Ribbon user interface. For more information, search help for the keyword "Ribbon."

Syntax

expression.ShortcutText

expression A variable that represents a CommandBarButton object.

Remarks

You can set this property only for command bar buttons that contain an OnAction macro.

Example

This example displays the shortcut text for the Open command (File menu) on the Microsoft Excel Worksheet menu bar in a message box.

Visual Basic for Applications
MsgBox (CommandBars("Worksheet Menu Bar"). _ Controls("File").Controls("New...).ShortcutText)
assign a procedure with a shortcut keystroke and caption ofv set a charting button on the command bar set shortcut key text display next to the command bar button shortcut shortcut text Shortcut Text Property shortcuttext shortcuttext property

See also: