This topic has not yet been rated - Rate this topic

SynonymInfo.Found Property

Office 2007
True if the thesaurus finds synonyms, antonyms, related words, or related expressions for the word or phrase. Read-only Boolean.

Syntax

expression.Found

expression   A variable that represents a SynonymInfo object.

Example

This example checks to see whether the thesaurus contains any synonym suggestions for the word "authorize."

Visual Basic for Applications
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

This example checks to see whether the thesaurus contains any synonym suggestions for the selection. If it does, the example displays the Thesaurus dialog box with the synonyms listed.

Visual Basic for Applications
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

This example removes formatting from the find criteria before searching the selection. If the word "Hello" with bold formatting is found, the entire paragraph is selected and copied to the Clipboard.

Visual Basic for Applications
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



Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ