SpellingSuggestions 集合对象

         
多种对象
SpellingSuggestions (SpellingSuggestion)

SpellingSuggestion 对象所组成的集合,该集合中的对象代表了指定单词或指定区域中第一个单词的所有拼写建议。

使用 SpellingSuggestions 集合

GetSpellingSuggestions 方法可返回 SpellingSuggestions 集合。当 SpellingSuggestions 方法应用于 Application 对象时,必须指定要检查的单词。当 GetSpellingSuggestions 方法应用于一个区域时,则检查该区域的第一个单词。下例检查活动文档中的任意单词是否存在拼写建议。如果有,则在消息框中显示这些建议。

For Each wd In ActiveDocument.Words
    Set sugg = wd.GetSpellingSuggestions
    If sugg.Count <> 0 Then
        For Each ss In sugg
            MsgBox ss.Name
        Next ss
    End If
Next wd

说明

不能在拼写建议集合中添加或删除建议。拼写建议是从主词典或自定义词典中获取的。