Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-14-2014, 09:21 PM
mark99k's Avatar
mark99k mark99k is offline Addin-specific keyboard shortcuts refuse to turn off Windows 7 32bit Addin-specific keyboard shortcuts refuse to turn off Office 2010 32bit
Novice
Addin-specific keyboard shortcuts refuse to turn off
 
Join Date: Oct 2012
Location: California USA
Posts: 20
mark99k is on a distinguished road
Unhappy Addin-specific keyboard shortcuts refuse to turn off

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
Reply With Quote
 

Tags
code, disable, keyboard shortcuts



Similar Threads
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
Addin-specific keyboard shortcuts refuse to turn off Can I turn off keyboard shortcuts? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft