Solved

Word 2007 Function Shortcut Key

Posted on 2011-03-09
6
529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

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

Expert Comment

by:Arno Koster
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
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.

 
LVL 19

Accepted Solution

by:
Arno Koster 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:Arno Koster
ID: 35138806
you're welcome !
0

Featured Post

Increase your protection from Zero Day threats!

Running two Antivirus' is never a good idea.
Taking advantage of Multiple Security layers on the other hand can often save your hide.
See which top notch security software brands have been proven to happily coexist together.
Reduce your chances of becoming a statistic.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
My experience with Windows 10 over a one year period and suggestions for smooth operation
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 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