Back to main page
Programs by Mike
Technical Writing by Mike
Graphic design by Mike
E-mail Mike

Importing abbreviations to AutoCorrect and QuickCorrect

If you are a Word 97 or a Word Perfect user you've no doubt noticed the power and simplicity of the AutoCorrect feature (called QuickCorrect in WP). This function is supposed to automatically correct the spelling of many commonly mistyped words such as "teh" instead of "the." AutoCorrect/QuickCorrect will do much more than that though. It will even function as a simple abbreviation expander by replacing "asn" with "The abdomen is soft and nontender." There is even a way to get a PRD abbreviation list into these "expanders".

Using PRD to create an expansion list

The first thing to do is find out how to create a list of your expansions and abbreviations. PRD has a utility that will do this for you. It is called PRTPRD.COM. All you have to do is run PRTPRD.COM (it should be in the pplus2 directory) either by typing in the filename at a DOS prompt or finding it with Windows Explorer and double-clicking the icon.

The program now brings up the menu where you can change the settings for printing the file. Choose the PRD file you want to print. The program starts with the file option highlighted at the bottom. If you press the Enter key you will be prompted for the PRD file you wish to print, you can also press F10 for a list of the available files in the directory. Press Enter again to choose the file. You should see the filename appear in the menu above, next to where it says File:.

Next arrow over to Endings. Press Enter and highlight Yes. Enter again. Now we are ready to tell PRTPRD where the printed file will go. Arrow over to Output and press Enter. Choose Disk since we want to print to a file. You will have to specify a filename and press Enter again. When you are done arrow over to Go and hit return. PRTPRD will now create a text file containing all your PRD entries.

Converting the PRD list to a WP8 macro

If you open the file in WP8 you will notice that your abbreviations are on the right then there are some spaces and then the expansion. Example:

abbrev This is my expansion.

We will have to remove those in between spaces and replace them with: ";" .

First, open the newly created file in WP8. Then open the Edit Menu and choose Find and Replace. In the find field enter the number of spaces you want to replace. (Usually I start with 9 or 10 spaces and work my way down to 3.) Then in the Replace field enter the text you want them to be replaced with. In this case we are making a WP8 macro to import them into QuickCorrect so we want to replace the spaces with ";". (Quotes must be included, the period isn't.) Press the Replace All button.

Next we want to replace the hard returns in the text file. So go back to the Find and Replace dialog and put the cursor in the Find field. Now open the Match menu and choose Codes. Scroll through the codes listing until you see HRt. Click the Insert button. In the Replace field we want to replace the hard returns with the following:

"; QuickCorrect!)[HRt]QuickCorrectAddItem("

You must put in the quotes and the [HRt] must be entered by going through the Replace menu and then choosing Codes, just like we did for the Find previously. Each entry of our file should now look like this:

QuickCorrectAddItem("abbr";"expansion"; QuickCorrect!)

You've just created a macro that will add all your PRD entries to your WP8 QuickCorrect file. Save the file with a .wcm extension so that WP8 will recognize it as a macro. Before running the macro it is a good idea to make a backup copy of your QuickCorrect file. You can do that by searching your hard drive (Start Menu | Find | Files or Folders...) for a file named wt80us.uwl. Save it to a floppy or another folder on your hard drive.

The only thing left to do is run the macro. This might take quite a while (maybe half an hour depending on how many entries you are adding) so be sure you don't have any stat reports waiting for you. When the macro is done, restart WP8 and check to see if your entries are now in QuickCorrect. One other thing you should be aware of is that if you have put a lot of entries into QuickCorrect it will take it a little longer to start WP8. Once, I put in 10,000 entries this way and it took about 3 minutes to get into WP8 every time I started it. Usually this isn't a big problem but it is something you should be aware of.

Configuring Word 97 to use Macros8.dot

There is a macro that ships with Word 97 called "AutoCorrect Utility" located in the Macros8.dot template. This macro will let you backup and restore your AutoCorrect file. It will also "restore" a fake AutoCorrect file that contains an abbreviation list you can define.

In order to use this macro you must first add Macros8.dot to your Normal.dot template. To do this open the Tools Menu, click on Templates and Add-Ins..., put a check next to Macros8.dot. Click the Okay button on the Templates and Add-Ins... dialog.

Backing up your AutoCorrect

Now that the template containing the macro we need is open, we can play the AutoCorrect macro by opening the Tools Menu and highlighting the Macro item, then clicking Macros... or you could hit Alt-F8.

To run the AutoCorrect macro highlight the line that says "Start_AutoCorrect" and press the Run button. This brings up a dialog that asks you if you want to Backup your AutoCorrect, Restore it, or Cancel the macro altogether. Let's start by clicking Backup.

Click Cancel when you get to the Save As... dialog since we want to look at the document Word creates for us. Then click Cancel again at the macro dialog. You should now be back in your document which will say "AutoCorrect Backup Document" at the very top. Below that you will see a table with three columns. The first column titled Name is where the abbreviation would go. The second column is titled Value and that is where you would put the expansion. The third column is called RTF and all of the entries in this column should read False.

Now that we know what format we need to create let's save this document. I named mine "AutoCorrect Backup.doc."

Formatting an abbreviation list into a table

The next thing we need is an abbreviation list to add to AutoCorrect. Once you have a list you need to arrange it so that it has an abbreviation and a tab, an expansion then another tab, then False. There should be one hard return between entries. Like this:

abb*expansion*False

asn*abdomen is soft and nontender*False

huge1*This is my very long expansion to show that you can continue the expansion to another line as long as you don't hit enter anywhere in the expansion and you keep your tabs in the right place.*False

(Tabs have been replaced by * for visualization purposes.)

As you can see longer expansions are allowed as long as you keep the tabs after the abbreviation and before the False.

You can do this using the list we created earlier by opening the PRD file and using Word's Replace... command (in the Edit menu) to replace the spaces between the abbreviation and expansion with tabs. You can record a macro that will add a tab and the word "False" before the hard return but after the expansion. You can also run the Replace command to replace paragraph marks (^p) with a tab, the word False, and a paragraph mark. The dialog would appear as follows:

Find: ^p
Replace: ^tFalse^p

The next step is turning this list into a table. To do this select all the text in the document by pressing Ctrl-A or opening the Edit Menu and choosing Select All. Now Open the Table Menu and choose Convert Text to Table. This brings up a dialog. Make sure that Columns is set to 3 and "Separate text at" has a dot next to Tabs. Click the Okay button. Your abbreviation list should now be in the form of a table.

Finishing touches

Go to the very top row of the table. Open the Table Menu and click Insert Rows. In the new row type Name in the first box, Value in the second, and RTF in the third. Next, do Ctrl-PgUp and press Enter to get out of the table and above it. Now type "AutoCorrect Backup Document" (without quotes) and save the document.

The final step is adding the list to your AutoCorrect. To do this press Alt-F8, highlight the line that says "Start_AutoCorrect," and press the Run button. Then click the Restore button, then Yes to replace. Find the document containing your abbreviation list or AutoCorrect backup, highlight it, and press Open. Test it by typing one of your abbreviations.

Author's Notes: The instructions for getting the AutoCorrect import macro into Word have changed with the 2000 and XP/2002 versions of Word. The quickest way to find the instructions for your version of Word is to go to the Microsoft Knowledge Base and enter "how to move word autocorrect entries between computers" as the search terms.

Copyright 1999 by Mike DeTuri
(This article originally appeared in the Fall 1999 issue of Perspectives.)