PDA

View Full Version : Keybindings are automatically removed after creating new in Word



rruckus
01-24-2014, 01:25 PM
Does anyone know how to solve this very odd issue? It looks like it may be a Word bug, but it's so fundamental that I can't imagine it would be! If you add any "keybinding" in Word through either VBA code or through the Word 2010 menus to any template then create a new document based on that template, the keybinding will work. Now if you open or "create new" of any regular Word document (not attached to that template) your key binding will no longer fire! Steps are:


Create a new word template (dotm)
Add a simple macro to that template (like "HelloWorld")
Add any keybinding to fire that Macro (you can do this via VBA code, make sure to set the Customization Context to the template, or through Word > Options > Customize Ribbon)
Save and close your template.
Now dbl-click your template to create a new document based on the template. Press your keybinding short-cut and it will work.
Now create a new blank Word document (based on Normal.dot) and switch back to your original document.
Keybindings will no longer work!


Does anyone have a solution for this!? I reproduced in Word 2010 and 2007.

fumei
01-24-2014, 10:40 PM
I can not reproduce this in 2003. I did all the steps and #7 works as it is supposed to. Keybinding functions.

rruckus
01-27-2014, 08:45 AM
Thank you, unfortunately I can reproduce this every time in Word 2007 and 2010! Anyone have a solution? I can't be the only one who uses keybindings in 2007/2010 and has noticed this critical issue.

fumei
01-27-2014, 02:54 PM
Can you please post a sample template file?

rruckus
01-28-2014, 09:47 AM
11173

To reproduce, save the attached file to your working DIR and remove the ".zip" from the file name. Then dbl-click the file to create a new instance based on the template. Try the keybinding "shift+backspace" and you will get a custom VBA message "Custom Backspace!". Now create a new blank Word document (ctrl+n or from the Word menu) and type something in that document. Now switch back to the original document and try "shift+backspace" again. The keybinding won't work!