KeyBinding.KeyCode2 property (Word)
Returns a unique number for the second key in the specified key binding. Read-only Long.
Syntax
expression. KeyCode2
expression An expression that returns a 'KeyBinding' object.
Example
This example displays the key codes of each key in the KeyBindings collection (the collection of all the customized keys in the active document).
Dim aKey As KeyBinding
CustomizationContext = ActiveDocument
For Each aKey In KeyBindings
If aKey.KeyCode2 <> wdNoKey Then
MsgBox aKey.KeyString & vbCr _
& "KeyCode1 = " & aKey.KeyCode & vbCr _
& "KeyCode2 = " & aKey.KeyCode2
Else
MsgBox aKey.KeyString & vbCr _
& "KeyCode1 = " & aKey.KeyCode
End If
Next aKey
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for