CommandParameter Property

Applies To

KeyBinding object, KeysBoundTo collection object.

Description

Returns the command parameter assigned to the specified shortcut key. Read-only String.

Note For information about commands that take parameters, see Add method (KeyBindings collection). Use the Command property to return the command name assigned to the specified shortcut key.

See Also

Command property.

Example

This example assigns a shortcut key to the FontSize command, with a command parameter of 8. Use the CommandParameter property to display the command parameter along with the command name and key string.

Set aKey = KeyBindings.Add(KeyCategory:=wdKeyCategoryCommand, Command:="FontSize", _
    KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyS), CommandParameter:="8")
MsgBox aKey.Command & Chr$(32) & aKey.CommandParameter & vbCr & aKey.KeyString