SynonymInfo.SynonymList Property

Word Developer Reference

Returns a list of synonyms for a specified meaning of a word or phrase. The list is returned as an array of strings. Read-only Variant.



expression   An expression that returns a SynonymInfo object.


This example returns a list of synonyms for the word "big," using the meaning "generous" in U.S. English.

Visual Basic for Applications
  Slist = SynonymInfo(Word:="big", LanguageID:=wdEnglishUS) _
For i = 1 To UBound(Slist)
    Msgbox Slist(i)
Next i

This example returns a list of synonyms for the second meaning of the selected word or phrase and displays these synonyms in the Immediate window of the Visual Basic editor. If there is no second meaning or if there are no synonyms, this is stated in a message box.

Visual Basic for Applications
  Set mySi = Selection.Range.SynonymInfo
If mySi.MeaningCount >= 2 Then
    synList = mySi.SynonymList(Meaning:=2)
        For i = 1 To UBound(synList)
            Debug.Print synList(i)
        Next i
    MsgBox "There is no second meaning for this word or phrase."
End If

See Also