Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-04-2011, 01:08 AM
tinfanide tinfanide is offline Word VBA: assign shortcut keys to sub??? Windows 7 64bit Word VBA: assign shortcut keys to sub??? Office 2010 32bit
Expert
Word VBA: assign shortcut keys to sub???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Word VBA: assign shortcut keys to sub???

Code:
Sub textHighlighter()

Selection.range.HighlightColorIndex = wdYellow

End Sub
I want to assign shortcut keys to this sub
when I highlight texts, just press the key to do the effect

I have tried
Code:
Application.OnKey "', ""
But doesn't work at all.
I mean thru VBA, not thru using the Macro Menu.


Thanks in advance.
Reply With Quote
  #2  
Old 12-04-2011, 07:04 PM
macropod's Avatar
macropod macropod is offline Word VBA: assign shortcut keys to sub??? Windows 7 64bit Word VBA: assign shortcut keys to sub??? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See: http://www.officekb.com/Uwe/Forum.as...keys-using-VBA
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-05-2011, 03:41 AM
tinfanide tinfanide is offline Word VBA: assign shortcut keys to sub??? Windows 7 64bit Word VBA: assign shortcut keys to sub??? Office 2010 32bit
Expert
Word VBA: assign shortcut keys to sub???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Yes, I got the codes and knew how. Thanks very much.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Mail Shortcut Keys? gratiot Outlook 3 07-29-2011 10:31 AM
Shortcut keys in Find&Replace fsdance Word 0 02-11-2011 03:27 PM
cant use shortcut keys (ctrl+c/v/z...) laro Office 0 10-08-2010 11:01 PM
Can't Assign Shortcut Keys Vicki F. Word 0 04-17-2010 03:03 PM
Assign name to a group in word document pankaj_saha Word 0 11-12-2009 10:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:06 AM.


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