Class AutoCorrect (Word VBA)

The class AutoCorrect represents the AutoCorrect functionality in Word.

Set

To use a AutoCorrect class variable it first needs to be instantiated, for example

Dim act as AutoCorrect
Set act = AutoCorrect

The following procedures can be used to set variables of type AutoCorrect: Application.AutoCorrect and Application.AutoCorrectEmail

For Each

Here is an example of processing the AutoCorrect items in a collection.

For Each ace In  AutoCorrect.OtherCorrectionsExceptions 
   response = MsgBox("Delete entry: " & ace.Name, vbYesNoCancel) 
    If response = vbYes Then 
        ace.Delete 
    Else 
        If response = vbCancel Then End 
    End If 
Next ace

Properties

CorrectCapsLock true if Word automatically corrects instances in which you use the CAPS LOCK key inadvertently as you type.

AutoCorrect.CorrectCapsLock = True

CorrectDays true if Word automatically capitalizes the first letter of days of the week.

AutoCorrect.CorrectDays = True

CorrectHangulAndAlphabet true if Microsoft Word automatically applies the correct font to Latin words typed in the middle of Hangul text or vice versa.

AutoCorrect.CorrectHangulAndAlphabet = True

CorrectInitialCaps true if Word automatically makes the second letter lowercase if the first two letters of a word are typed in uppercase. For example, "WOrd" is corrected to "Word.

AutoCorrect.CorrectInitialCaps = True

CorrectKeyboardSetting true if Microsoft Word automatically transposes words to their native alphabet if you type text in a language other than the current keyboard language.

AutoCorrect.CorrectKeyboardSetting = True

CorrectSentenceCaps true if Word automatically capitalizes the first letter in each sentence.

AutoCorrect.CorrectSentenceCaps = True

CorrectTableCells true to automatically capitalize the first letter of table cells.

AutoCorrect.CorrectTableCells = True

DisplayAutoCorrectOptions true for Microsoft Word to display the AutoCorrect Options button.

AutoCorrect.DisplayAutoCorrectOptions = True

Entries returns an AutoCorrectEntries collection that represents the current list of AutoCorrect entries.

Dim acesEntries As AutoCorrectEntries
Set acesEntries = AutoCorrect.Entries

FirstLetterAutoAdd true if Word automatically adds abbreviations to the list of AutoCorrect First Letter exceptions.

AutoCorrect.FirstLetterAutoAdd = True

FirstLetterExceptions returns a FirstLetterExceptions collection that represents the list of abbreviations after which Word won't automatically capitalize the next letter.

Dim flesFirstLetterExceptions As FirstLetterExceptions
Set flesFirstLetterExceptions = AutoCorrect.FirstLetterExceptions

HangulAndAlphabetAutoAdd true if Microsoft Word automatically adds words to the list of Hangul and alphabet AutoCorrect exceptions.

AutoCorrect.HangulAndAlphabetAutoAdd = True

HangulAndAlphabetExceptions returns a HangulAndAlphabetExceptions collection that represents the list of Hangul and alphabet AutoCorrect exceptions.

Dim haasHangulAndAlphabetExceptions As HangulAndAlphabetExceptions
Set haasHangulAndAlphabetExceptions = AutoCorrect.HangulAndAlphabetExceptions

OtherCorrectionsAutoAdd true if Microsoft Word automatically adds words to the list of AutoCorrect exceptions on the Other Corrections tab in the AutoCorrect Exceptions dialog box (AutoCorrect Options command, Tools menu). Word adds a word to this list if you delete and then retype a word that you didn't want Word to correct.

AutoCorrect.OtherCorrectionsAutoAdd = True

OtherCorrectionsExceptions returns an OtherCorrectionsExceptions collection that represents the list of words that Microsoft Word won't correct automatically.

Dim ocesOtherCorrectionsExceptions As OtherCorrectionsExceptions
Set ocesOtherCorrectionsExceptions = AutoCorrect.OtherCorrectionsExceptions

Parent returns an object that represents the parent object of the specified AutoCorrect object.

Dim objParent As Object
Set objParent = AutoCorrect.Parent

ReplaceText true if Microsoft Word automatically replaces specified text with entries from the AutoCorrect list.

AutoCorrect.ReplaceText = True

ReplaceTextFromSpellingChecker true if Microsoft Word automatically replaces misspelled text with suggestions from the spelling checker as the user types. Word only replaces words that contain a single misspelling and for which the spelling dictionary only lists one alternative.

AutoCorrect.ReplaceTextFromSpellingChecker = True

TwoInitialCapsAutoAdd true if Microsoft Word automatically adds words to the list of AutoCorrect Initial Caps exceptions. A word is added to this list if you delete and then retype the uppercase letter (following the initial uppercase letter) that Word changed to lowercase.

AutoCorrect.TwoInitialCapsAutoAdd = True

TwoInitialCapsExceptions returns a TwoInitialCapsExceptions collection that represents the list of terms containing mixed capitalization that Word won't correct automatically.

Dim ticsTwoInitialCapsExceptions As TwoInitialCapsExceptions
Set ticsTwoInitialCapsExceptions = AutoCorrect.TwoInitialCapsExceptions