Solved

Word 2007 Function Shortcut Key

Posted on 2011-03-09
6
522 Views
Last Modified: 2012-05-11
Is there a way to program a function key, as in the F1-F12 keys to perform a function when pressed?  More specifically, I frequently need to insert a phrase into word documents, I would like to be able to program one of the "F" keys, so when I press it, it will automatically insert that phrase into Word.
0
Comment
Question by:fireguy1125
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35085437
you can use macros
0
 
LVL 19

Expert Comment

by:akoster
ID: 35093460
if you record a macro, you can assign it to a key or key combination. As F1 is taken for help functionality, you can assign F2 ~ F12 to an arbitrary macro.
When combining you can use even more macro's : Shift-F2 ~ Shift-F12, Alt-F1 ~ Alt-F12, Ctrl-F1 ~ Ctrl-F12, Ctrl-Alt-F1 ~Ctrl-Alt-F12 and Alt-Shift-F1 ~ Alt-Shift-F12 are all available.

0
 
LVL 1

Author Comment

by:fireguy1125
ID: 35134964
Can I please have instructions as to how to create a macro to assign to let's say, the F2 key, that inserts a phrase into a document wherever the cursor is?
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 35136497
Sure,

- open word
- Click the Microsoft Office Button, and then click Word Options.
- In the Top options for working with Word section of the Word Options dialog box, click Personalize.
- Select Show Developer tab in the Ribbon, as shown in the next figure.
- Click OK.
- go to the developer tab in the ribbon
- click on "Record Macro" in the code section on the left of the tab
- enter a name for the macro (eg. insert_phrase), please note that no spaces are allowed (replace with underscores) and it must begin with a letter ("2_weekly_macro" is not allowed, but "macro_2_weeks" is allowed).
- enter the location of the macro (in normal.dot when you want to enable the macro for all word documents or in this document when the macro should only be enabled in the active document)

- click on the button with a keyboard on it (thereby assigning the macro to a function key)
- press [F2] (the pressed key or key combination will be noted in the popup)
- click on "assign"
- click on "close"

now type something in the word document

- click on "stop recording" in the code section on the left of the developer tab, same place as the record macro button
- press [Alt]-[F11] to open the visual basic editor
- navigate to module in this document or in normal.dot, look for the name of the macro

eg. for a macro named 'insert_phrase', you should be looking for something like

Sub insert_phrase()
'
' insert_phrase Macro
'
'
    Selection.TypeText Text:="something"
End Sub

Open in new window


When recording the macro, the structure above is generated. When you typed something during the recording of the macro, the typed text will be visible after the selection.typetext statement. When you have performed more actions, these can be recorded as well leading to a larger macro code.

- adapt the particular phrase that you would like to enter when clicking on F2, such as
Selection.TypeText Text:="This phrase is automagically inserted on pressing F2 !"

Open in new window


- close the VBA editor

- press the [f2] key in word

voila






0
 
LVL 1

Author Closing Comment

by:fireguy1125
ID: 35137453
Worked great.  Thanks and super easy!
0
 
LVL 19

Expert Comment

by:akoster
ID: 35138806
you're welcome !
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now