HOW TO
An accelerator key is the mapping of a particular keyboard sequence to execute a command.
Note:
Code in the Project's ThisDocument code module will only run in the current map document. If you want to store the code in all your map documents, open the Normal.mxt ThisDocument code module instead.
Code:
Public Sub myShortcut()
Dim mAccTab As IAcceleratorTable
Set mAccTab = ThisDocument.Accelerators
Dim newAcc As Boolean
newAcc = mAccTab.Add("Project.ThisDocument.mymacro", vbKeyZ, False, True, False)
End Sub
Public Sub mymacro()
MsgBox "This test worked"
End Sub
Get help from ArcGIS experts
Download the Esri Support App