![]() |
#1
|
||||
|
||||
![]()
Hi folks. I have an .dotm add-in containing about 20 macros. It also contains two other macros that let my users enable or disable a set of keyboard shortcuts for these macros as needed -- that is, only for specific documents. (The shortcuts commandeer some commonly used built-in key combinations, so I want them enabled only when a user explicitly allows it.) I've done this successfully before. But on this file, for some reason, merely loading the add-in enables the shortcuts -- in all documents.
I've confirmed via the Customize Keyboard dialog that these shortcuts are *not* enabled in the .dotm itself, but I've also explicitly disabled them via code just in case. I've tried unloading all other add-ins and had Word rebuild the Normal template to verify they're not hiding there either. No luck. I'm sure they're enabled in the add-in. (They go away if I unload it.) What could be causing this?? There are no automacros in the file, and the shortcut-enabling macro (see below) isn't called by any other macro. All shortcuts are set with the Customization Context shown, the active document. (not Normal or ThisDoc). Sub KM1(mac, k1) CustomizationContext = ActiveDocument KeyBindings.Add KeyCode:=BuildKeyCode(k1), _ KeyCategory:=wdKeyCategoryMacro, Command:=mac End Sub Sub KM2(mac, k1, k2) CustomizationContext = ActiveDocument KeyBindings.Add KeyCode:=BuildKeyCode(k1, k2), _ KeyCategory:=wdKeyCategoryMacro, Command:=mac End Sub Sub EnableShortcuts KM1 "LengthenLine", wdKeyF4 KM1 "ShortenLine", wdKeyF5 [...and so on...] KM2 "SelectPrevPair", wdKeyControl, wdKeyF4 KM2 "SelectNextPair", wdKeyControl, wdKeyF5 [...and so on...] Thanks in advance for any clues at all. Mark |
Tags |
code, disable, keyboard shortcuts |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create keyboard shortcuts for a specific font | ravl13 | Word | 2 | 04-07-2013 05:45 AM |
Is there a way to list all keyboard shortcuts? | Jennifer Murphy | Word | 1 | 08-02-2012 01:48 PM |
![]() |
martinlest | Outlook | 1 | 06-10-2012 09:49 PM |
Impermanent keyboard shortcuts | Subligaria | Word | 2 | 11-01-2011 12:41 PM |
Customizing Keyboard Shortcuts | zextrot | Outlook | 0 | 11-11-2010 01:43 PM |