KeyCode Property

Microsoft Word Visual Basic

method when you're adding key bindings by using the Add method of the KeyBindings object.

expression.KeyCode

expression    Required. An expression that returns a KeyBinding object.

Example

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

Dim lngCode As Long
Dim kbLoop As KeyBinding

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