' \\ Code for Module1
Option Explicit
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
' \\ Code for Module2
Option Explicit
' \\ Test sub for keybinding
Sub TestKeybinding()
MsgBox "We have a winner", vbInformation, "Succes"
End Sub
|