FirstLetterExceptions Property

Microsoft Word Visual Basic

FirstLetterExceptions Property

       

Returns a FirstLetterExceptions collection that represents the list of abbreviations after which Word won't automatically capitalize the next letter. This list corresponds to the list of AutoCorrect exceptions on the First Letter tab in the AutoCorrect Exceptions dialog box (AutoCorrect command, Tools menu).Read-only.

For information about returning a single member of a collection, see Returning an Object from a Collection.

Example

This example adds "apt." to the list of AutoCorrect First Letter exceptions.

AutoCorrect.FirstLetterExceptions.Add "apt."

This example deletes the specified AutoCorrect First Letter exception if it exists.

Dim strException As String
Dim fleLoop As FirstLetterException
Dim blnMatch As Boolean
Dim intConfirm As Integer

strException = _
    InputBox("Enter the First Letter exception to delete.")
blnMatch = False

For Each fleLoop in AutoCorrect.FirstLetterExceptions
    If fleLoop.Name = strException Then
        blnMatch = True
        intConfirm = MsgBox("Are you sure you want to delete " _
            & fleLoop.Name, 4)
        If intConfirm = vbYes Then
            fleLoop.Delete
        End If
    End If
Next fleLoop

If blnMatch <> True Then
    MsgBox "There was no First Letter exception: " _
        & strException
End If