Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2014, 05:36 PM
ptmuldoon ptmuldoon is offline Assign Key via VBA? Windows 7 64bit Assign Key via VBA? Office 2013
Advanced Beginner
Assign Key via VBA?
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default Assign Key via VBA?

I know how to assign a shortcut key to a macro via the Options Menu in Word. But is it possible to assign the shortcuy key on Word's startup?

Essentially, I am creating a macro that will go in the user's Word Startup folder for all employees in my office. But he/she should not need to assign the macro key shortcut on their own.



Thus, I'm trying to assign a shortcut key and/or a quickaccess menu item to run the when word opens.

I think its possible, i'm just not the strongest with Word and VBA, with google being my main source of help so far (and macropod !)
Reply With Quote
  #2  
Old 11-30-2014, 07:34 PM
ptmuldoon ptmuldoon is offline Assign Key via VBA? Windows 7 64bit Assign Key via VBA? Office 2013
Advanced Beginner
Assign Key via VBA?
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

I think i'm close with this, but when I copy the dotm file to the start folder of another pc, its not working. It appears as if the file is not even opening when I start Word, although it is in the correct start folder as well.

Code:
Sub AutoOpen()
     With Application
         ' \\ Do customization in THIS document
         ' .CustomizationContext = ThisDocument
         
         ' \\ Add keybinding to this document Shorcut: Alt+0
        .KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyL), _
        KeyCategory:=wdKeyCategoryCommand, _
        Command:="ChangeFileLinks"
    End With

End Sub
Reply With Quote
  #3  
Old 11-30-2014, 08:26 PM
gmaxey gmaxey is offline Assign Key via VBA? Windows 7 32bit Assign Key via VBA? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Change your macro name to AutoExec
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign Key via VBA? how to assign a labor resource more than once ketanco Project 3 02-11-2014 12:23 PM
Assign Key via VBA? Assign a value to a Content Control SuzeG Word VBA 10 12-08-2013 08:04 AM
Assign Key via VBA? Assign Hotkey Andrew H Word VBA 3 11-26-2012 09:56 PM
VBA to Assign Aliases jerem Word VBA 3 12-08-2011 07:11 PM
Assign Key via VBA? Assign functions to F1, etc. ibclare Office 4 06-02-2011 03:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:50 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