SynonymInfo.SynonymList Property
SynonymInfo.SynonymList Property
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.

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

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



© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View