Solved

Word 2007 Function Shortcut Key

Posted on 2011-03-09
6
517 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
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 …

760 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

19 Experts available now in Live!

Get 1:1 Help Now