Solved

Word 2007 Function Shortcut Key

Posted on 2011-03-09
6
533 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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