AutoCorrect Members

The AutoCorrect object has the following members. Key members (shown in bold) are covered in the following reference section:

AddReplacement

Application

AutoExpandListRange

CapitalizeNamesOfDays

CorrectCapsLock

CorrectSentenceCap

Creator

DeleteReplacement

DisplayAutoCorrectOptions

Parent

ReplacementList

ReplaceText

TwoInitialCapitals

 

The AutoCorrect object provides a set of properties that determine how Excel handles automatic correction. Most of the AutoCorrect members are True/False properties that enable or disable specific Auto Correct options. The following code displays a list of the current Auto Correct settings in Excel:

Sub ShowAutoCorrectSettings(  )
    With Application.AutoCorrect
        Debug.Print .AutoExpandListRange
        Debug.Print .CapitalizeNamesOfDays
        Debug.Print .CorrectCapsLock
        Debug.Print .CorrectSentenceCap
        Debug.Print .DisplayAutoCorrectOptions
        Debug.Print .ReplaceText
        Debug.Print .TwoInitialCapitals
    End With
End Sub

These properties correspond to the settings on the AutoCorrect dialog box (Figure 7-4). To see that dialog, choose Tools → AutoCorrect Options.

Displaying the AutoCorrect options

Figure 7-4. Displaying the AutoCorrect options

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.