View Single Post
 
Old 06-29-2024, 09:18 AM
savvy savvy is offline Windows 11 Office 2019
Novice
 
Join Date: Aug 2020
Location: Toronto
Posts: 23
savvy is on a distinguished road
Default

oops '---------------------------------------------
'7 7 7 7

' Subroutine to enumerate and list available key bindings
Sub GetBindings()
Debug.Print "Starting ListAvailableKeyBindings"
Dim aKB As KeyBinding
CustomizationContext = ActiveDocument.AttachedTemplate ' Use ThisDocument or AttachedTemplate

' Loop through each key binding and print details
For Each aKB In KeyBindings
Debug.Print "Key String: " & aKB.keyString
Debug.Print "Command: " & aKB.Command
' Additional options to explore
' Debug.Print "CommandParameter: " & aKB.CommandParameter
' Debug.Print "KeyCategory: " & aKB.KeyCategory

' Uncomment and use these lines as needed:
' aKB.Disable ' Equivalent to clicking the Remove button in the Customize Keyboard dialog box
' aKB.Clear ' Resets a built-in command to its default key assignment
' aKB.Rebind wdKeyCategoryCommand, "TestKeybinding" ' Rebinds a key to another command
' aKB.Execute ' Executes the key binding command

Debug.Print "---"
Next aKB
Debug.Print "Ending ListAvailableKeyBindings"
End Sub
'---------------------------------------------
'7 7 7 7
Reply With Quote