Avatar of rreiss60
rreiss60
Flag for United States of America

asked on 

reset keybinding word vba macro

I found this code on the internet, VBA Express website, I believe:

'Module1:

Sub AddKeyBinding()
    With Application
         ' \\ Do customization in THIS document
        .CustomizationContext = ThisDocument
         
         ' \\ Add keybinding to this document Shorcut: Alt+0
        .KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyAlt, wdKey0), _
        KeyCategory:=wdKeyCategoryCommand, _
        Command:="TestKeybinding"
    End With
End Sub

"TestKeybinding" is a sub in another module, "module2"

If I wanted to reset the keybindings back to the default setting, how should the code be modified?  Would I put it at the end of module2, or at the end of module1?
Visual Basic.NETMicrosoft ApplicationsMicrosoft Development

Avatar of undefined
Last Comment
rreiss60

8/22/2022 - Mon