Found 属性

       

SynonymInfo 对象:如果该属性值为 True,则在同义词库里找到了单词或短语的同义词、反义词、相关单词或相关短语等。Boolean 类型,只读。

Find 对象:如果该属性值为 True,则查找找到了匹配项。Boolean 类型,只读。

示例

本示例检测同义词库里是否有关于单词“authorize”的同义词方面的建议。

Dim siTemp As SynonymInfo

Set siTemp = SynonymInfo(Word:="authorize", _
    LanguageID:=wdEnglishUS)
If siTemp.Found = True Then
    Msgbox "The thesaurus has suggestions."
Else
    Msgbox "The thesaurus has no suggestions."
End If

本示例检测同义词库中是否有关于所选内容的同义词方面的建议。如果有,则将显示列有同义词的“同义词库”对话框。

Dim siTemp As SynonymInfo

Set siTemp = Selection.Range.SynonymInfo
If siTemp.Found = True Then
    Selection.Range.CheckSynonyms
Else
    Msgbox "The thesaurus has no suggestions."
End If

在查找选定部分之前,清除查找条件中的格式。如果查找到的单词“Hello”为加粗格式,则选定整个段落,并将其复制至剪贴板上。

With Selection.Find
    .ClearFormatting
    .Font.Bold = True
    .Execute FindText:="Hello", Format:=True, Forward:=True
    If .Found = True Then
        .Parent.Expand Unit:=wdParagraph
        .Parent.Copy
    End If
End With