Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-05-2013, 04:55 PM
fumei fumei is offline Need Help With How To Use KeyBindings Windows 7 64bit Need Help With How To Use KeyBindings Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Keybindings are document level functions. That is, they work in the document that has that keybinding. If the document does not have the keybinding...it does not have the keybinding.

That being said, if both documents are generated from the same template, and that template has the keybinding AND the keybinding is set with the Document_New event - when the template creates a new document - then the keybinding will work in both.
Code:
Private Sub Document_New()
CustomizationContext = ActiveDocument.AttachedTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyReturn), _
      KeyCategory:=wdKeyCategoryMacro, Command:="EnterKeyMacro"
End Sub

I must say though that using the Enter key like this is very limited unless you also add code to make the Enter key acts like a normal Enter key. Otherwise it will NEVER act like a normal enter key.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help With How To Use KeyBindings KeyBindings in PowerPoint? tinfanide PowerPoint 1 03-16-2013 10:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:17 PM.


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