AutoCorrect Generator

Home Up Odds & Ends Photo Gallery Search Contact Me

 

 

The information in this website is provided without risk or obligation and free of charge.  However, if you have benefitted from my efforts here and would like to make a contribution to help me continue and maintain this work then any donation will be greatly appreciated. Please click the adjacent button to access PayPal.  Thank you.
 

Entering a long list of AutoCorrect entries manually in Word can be a tedious task.  This Microsoft Word Help and Tips Page provides a method using an AutoCorrect list in the form of a two column table and a simple macro.

First create a two column table with as many rows as you want available to create AutoCorrect entries.  Label the left column Wrong and the right column Right.  Enter your wrong entries or short cut text in the Wrong column and the correct or expanded text in the Right column.  Here is a small sample to illustrate how your file should be laid out: 

Next copy the following macro and paste it in the project module of your document.  It is a good idea to save the document first:

 

Sub MultiAutoCorrectGenerator()

Dim oDoc As Document
Dim i As Integer
Dim Wrong As Range
Dim Right As Range

Set oDoc = ActiveDocument
Selection.Tables(1).Cell(1, 1).Range.Select
Selection.Collapse
For i = 2 To oDoc.Tables(1).Rows.Count
    If oDoc.Tables(1).Rows(i).Cells(1).Range.Characters.Count > 1 Then
        Set Wrong = oDoc.Tables(1).Cell(i, 1).Range
        Wrong.End = Wrong.End - 1
        Set Right = oDoc.Tables(1).Cell(i, 2).Range
        Right.End = Right.End - 1
        AutoCorrect.Entries.Add Name:=Wrong, Value:=Right
    End If
Next i
End Sub
For code to do something similiar with AutoText see fellow MVP Jay Freedmans AutoText Loader macro at:

 http://jay-freedman.info/autotextloader2.zip
Need help applying macros?  See fellow MVP Graham Mayor's  Guide for Installing Macros 
Now simply run the macro and you are all done!!

Looking for something else?

Google