KeyCode Property

Applies To

KeyBinding object.

Description

Returns a unique number for the first key in the specified key binding. Read-only Long.

Note You create this number by using the BuildKeyCode method when you're adding key bindings by using the Add method of the KeyBindings object.

See Also

BuildKeyCode method, KeyCode2 property, KeyString method, KeyString property.

Example

This example displays a message if the KeyBindings collection includes the ALT+CTRL+W key combination.

CustomizationContext = NormalTemplate
aCode = BuildKeyCode(wdKeyAlt, wdKeyControl, wdKeyW)
For Each aKey In KeyBindings
    If aCode = aKey.KeyCode Then
        MsgBox aKey.KeyString & " is already in use"
    End If
Next aKey