Forum Discussion
Macro keyboard shortcuts not working in new macro template document
Are you saving your macros to the Normal template? Are you also saving the shortcuts in that same template?
I have no idea if the original poster in this thread found a working solution, unfortunately.
Stefan_Blom Yes, I am saving my macros to the Normal template--at least I think that is the case. I am creating the keyboard shortcuts using a macro like this:
'CreateBookShortcuts
'Assigns convenient shortcut keys to the book macros
Sub CreateBookShortcuts()
CustomizationContext = NormalTemplate
KeyBindings.Add _
KeyCode:=BuildKeyCode(wdKeyControl, wdKeyShift, wdKeyH), _
KeyCategory:=wdKeyCategoryCommand, _
Command:="FormatHTMLTag"
KeyBindings.Add _
KeyCode:=BuildKeyCode(wdKeyControl, wdKeyShift, wdKeyP), _
KeyCategory:=wdKeyCategoryCommand, _
Command:="FormatCSSProp"
KeyBindings.Add _
KeyCode:=BuildKeyCode(wdKeyControl, wdKeyShift, wdKeyV), _
KeyCategory:=wdKeyCategoryCommand, _
Command:="FormatCSSVal"
This macro is part of a module `BookMacros` that lives in the Normal' template's 'Modules' folder. When I inspect keystroke shortcuts through File->Options->Customize Ribbon, I see that the keystroke shortcuts I have defined do indeed show up:
Keystroke shortcut exists, but doesn't work!
However, the keystroke shortcuts do NOT work!! The only way I can get them to run is to manually run them from the Developer->Macros dialog.
This is really strange. These shortcuts worked fine previous to my recent transition to Windows 11.
Thanks in advance for any help you can provide.
Note: I have tried "Reset Macros..." and then re-running the macro to redefine the keystroke shortcuts. However, that didn't work.
- hchou56May 24, 2022Copper Contributor
I have the exact same issue. The strange thing is that at 6 AM today, they (the macros with shortcut keys assigned) worked perfectly. At 7:35 AM, the shortcut keys to the macros stopped working. Strange thing is that I can still run my other shortcut keys assigned to styles (i.e., Heading 1, Heading 2, etc.) and other predefined functions in the MS Words. Just can't run them with my own macros anymore.
Please help.
- Stefan_BlomMay 24, 2022MVP
Are you running Word for Windows?
Are the macros and their shortcuts stored in the same template? Is the template with macros loaded as a global template or accessed by other means?
- GandarufuuuJan 11, 2024Copper Contributor
Stefan_Blom
I'm experiencing the same problem, although my Word randomly started to show this error since today
Can you please help me / us with this? My macros are also saved in the normal.dotm, but I can't even run them from the marco menu any more.