Can typing macros be used in Word?

R

Robert Crandal

I was wondering, can I install (or program) text-typing macros into
Word 2007? The type of macros that I am looking for are the
only commonly found in other text editors, such as Emacs on Unix.

For example, if someone types the string "zfbi" into a document,
I want Word to immediately convert this string to "Federal Bureau
of Investstigation. Or, "zwww" should be replaced with "World
Wide Web".

BTW, I have a master file of text strings (or macros) that I want
Word to recognize and replace with expanded strings. So, I'm
just wondering what's a good way to implement these macros using
VBA, if at all possible.

Thank you!
 
J

Jay Freedman

Although it's possible to use macros for this, it's very
"un-Word-like". Word has two other features, AutoText and AutoCorrect,
that are intended for making text replacements. See
http://www.word.mvps.org/FAQs/Customization/AutoText.htm and
http://www.word.mvps.org/FAQs/Customization/AutoCorrect.htm for
discussions.

An alternative that works everywhere in Windows is a key assignment
program such as AutoHotKey (www.autohotkey.com).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
D

Doug Robbins - Word MVP

You can define AutoCorrect entries that can be used for that purpose.

To do that, click on the Office button and then on Word Options and then on
Proofing and then on AutoCorrect Options and in the "Replace text as you
type" section of the AutoCorrect tab of the dialog, enter the phrase that
you want into "With:" control. Then enter the text that you want to be
replaced into the "Replace:" control and click on OK.

For example with "Federal Bureau of Investigation" in the "With:" control,
enter "zfbi" in the "Replace:" control then click on OK.

Repeat for as many items as you want.

The above instructions are for Word 2007. In Office 2003, you get to the
AutoCorrect Options dialog by accessing the Tools menu.



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
R

Robert Crandal

Great, that's what I needed. However, might there be a faster way to add
my
entries?? I have a couple hunded items that I want to be auto replaced and
I
would really hate to enter all entries manually.

Thank you!
 
G

Graham Mayor

You can add them from a table - see
http://word.mvps.org/FAQs/Customization/ExportAutocorrect.htm or in the case
of Word 2007/10, there's an updated version at http://jay-freedman.info/.
Create a new document from the template and it will prompt to backup or
restore the entries - choose the backup option and modify the table it
creates to include your new entries, then use the restore option to add
them..

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top