AntonymList Property
Applies To
SynonymInfo object.
Description
Returns a list of antonyms for the word or phrase. The list is returned as an array of strings. Read-only Variant.
Remarks
The AntonymList property is a property of the SynonymInfo object, which can be returned from either a range or the application. If this object is returned from the application, you specify the word to look up and the language to use. When the object is returned from a range, the range is looked up using the language of the range.
See Also
MeaningList property, SynonymList property.
Example
This example returns a list of antonyms for the word "big" in U.S. English.
Alist = SynonymInfo(Word:="big", LanguageID:=wdEnglishUS).AntonymList
For i = 1 To UBound(Alist)
Msgbox Alist(i)
Next i
This example returns a list of antonyms for the word or phrase in the selection and displays them in the Immediate window in the Visual Basic Editor.
antList = Selection.Range.SynonymInfo.AntonymList
If UBound(antList) <> 0 Then
For i = 1 To UBound(antList)
Debug.Print antList(i) & Str(i)
Next i
Else
Msgbox "No antonyms were found."
End If
This example returns a list of antonyms for the third word in the active document, if there are any.
Set myRange = ActiveDocument.Words(3)
myalist = myRange.SynonymInfo.AntonymList
If Ubound(myalist) = 0 Then
MsgBox "There are no anytonyms for the third word."
Else
For i = 1 To UBound(myalist)
Msgbox myalist(i)
Next I
End If