View Single Post
 
Old 06-25-2020, 04:10 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

ThisDocument is the file the code you are running sits in.

If you wanted the keyboard shortcut to work on all documents you could put it in
.CustomizationContext = NormalTemplate

or restrict it to a specific template
.CustomizationContext = ActiveDocument.AttachedTemplate

I recommend you set the keyboard context to the same template that holds the code it is trying to run.

You might also include the module name to ensure there is no confusion in case you have the same macro name in more than one module.
Command:="ModuleName.printAllRecords"
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote