SpellingOptions 对象

         
Application
SpellingOptions

代表工作表的各种拼写检查选项。

SpellingOptions 对象用法

可用 Application 对象的 SpellingOptions 属性返回一个 SpellingOptions 对象。

返回一个 SpellingOptions 对象后,便可用下列属性来设置或返回各种拼写检查选项。

下例用 IgnoreCaps 属性来禁用对全部都是大写字母的单词的拼写检查。在本示例中,拼写检查程序可以识别“Testt”而不识别“TESTT”。

Sub IgnoreAllCAPS()

    ' Place mispelled versions of the same word in all caps and mixed case.
    Range("A1").Formula = "Testt"
    Range("A2").Formula = "TESTT"

    With Application.SpellingOptions
        .SuggestMainOnly = True
        .IgnoreCaps = True
    End With

    ' Run a spell check.
    Cells.CheckSpelling

End Sub