Word doesn't show the keyboard shortcuts that Barry has associated with macros, so he wonders how he is supposed to remove the shortcuts. He has read about how he is supposed to remove keyboard shortcuts associated with macros (i.e., Office button | Options | Customize | Keyboard Customize; select Macros on the left, and select a given macro on the right). However, the "current keys" box remains blank when Barry selects a given macro, even though when editing he can press the shortcut sequence and the macro runs. He wonders how he can delete the shortcut associated with a macro since it's not showing up in the "current keys" box.
This does, indeed, seem to be a problem with Word. One can assume that it will be fixed in a future update to the program, but that doesn't help with getting the shortcut removed now. The following general steps may help:
The purpose of these steps is to force Word to conclude that the macro associated with the shortcut is no longer available, and thus delete the shortcut. After these steps, you should theoretically be able to go back into the VBA Editor and put the macro code back into it, and the shortcut should be gone.
If it is not gone, then the problem may best be solved by fiddling around with the Normal template. Create a new, empty template (using a different name than Normal), and then transfer all your macros and styles from Normal to the new template. Then, rename Normal to something else and rename the new template as your Normal template. When you restart Word, you then have all your macros and styles, but any custom shortcuts should now be gone. (They are stored in the Normal template, but there is no easy way to transfer them from one template to another.)
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11919) applies to Microsoft Word 2007 and 2010.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Associate a macro with a shortcut key, and at some time you may want to break that association. (Perhaps so the shortcut ...
Discover MoreThere are a myriad of ways in which a date can be formatted: day first, month first, number of digits in the year, etc. ...
Discover MoreVBA is great at working with both strings and numbers. At some point, you may have a number you need to convert to a ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2024-08-07 10:03:28
Andrew
Or, better than the KeyBindings Collection you could use the KeysBoundTo collection (see https://learn.microsoft.com/en-us/office/vba/api/word.keysboundto), with which I was previously unfamiliar, to obtain all of the KeyBinding objects assigned to a command, style, macro, or other item in the current context. Based on the example in that link, you should be able to remove the keys from a macro like this:
CustomizationContext = NormalTemplate
For Each myKey In KeysBoundTo(KeyCategory:=wdKeyCategoryMacro, Command:="MacroName")
myKey.Clear
Next myKey
2024-08-07 09:48:48
Andrew
Or, in VBA, you could use the KeyBindings collection to obtain the KeyBinding object for the key the macro is bound to, and then execute its .Clear method, which "Removes the specified key binding from the KeyBindings collection and resets a built-in command to its default key assignment." Haven't tested this though.
Also note, the KeyBindings.ClearAll command "Clears all the customized key assignments and restores the original Microsoft Word shortcut key assignments." I do use this with a custom macro that then rebinds my custom assignments - which I use a couple times a year when Word somehow loses track of one or more of my bindings - saving me *much* grief!
Andy.
2024-08-06 06:38:14
Dr. Bartolo
The tip says that "there is no easy way to transfer [shortcuts] from one template to another" but I think that this may be incorrect.
Word allows one to export "Office customizations" and I believe that these small files include shortcuts, although I am not 100% sure. Once exported these files can also later be imported, although in my experience this sometimes does not work, for reasons I have never figured out - or tried to since I have always found ways around the issue.
The place to export (and import) customizations in Word (and it is similar in all other Office programs) is: Office button | Options | Customize Ribbon | Import/Export. This is aimed at backing up the the ribbon and quick access toolbar, but as I said I think it may also include shortcuts.
I should be interested to know from others if this workaround works for shortcuts as well as for the ribbon and quick access toolbar.
2017-08-17 05:32:43
Ethan Hack
I can see keyboard shortcuts for macros, so this is not a universal problem. Could there be something in Word configuration that causes it?
2012-07-16 16:36:34
Maybe it varies with the version of Word being used, but I've always found that changing the name of the macro cuts the link.
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments