SynonymInfo.SynonymList property (Word)

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.

Syntax

expression. SynonymList( _Meaning_ )

expression An expression that returns a 'SynonymInfo' object.

Example

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

Slist = SynonymInfo(Word:="big", LanguageID:=wdEnglishUS) _ 
 .SynonymList(Meaning:="generous") 
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.

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 
Else 
 MsgBox "There is no second meaning for this word or phrase." 
End If

See also

SynonymInfo Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.