KeyBinding.KeyString Property

Word Developer Reference

Returns the key combination string for the specified keys (for example, CTRL+SHIFT+A). Read-only String.

Syntax

expression.KeyString

expression   Required. A variable that represents a KeyBinding object.

Example

This example displays the key combination string for the first customized key combination in the Normal template.

Visual Basic for Applications
  CustomizationContext = NormalTemplate
If KeyBindings.Count >= 1 Then
    MsgBox KeyBindings(1).KeyString
End If

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

Visual Basic for Applications
  Dim aCode As Long
Dim aKey As KeyBinding

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

See Also