Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Word 2007 Function Shortcut Key

Posted on 2011-03-09
6
Medium Priority
?
540 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 19

Accepted Solution

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
New style of hardware planning for Microsoft Exchange server.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

719 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