RelatedWordList Property

Microsoft Word Visual Basic

RelatedWordList Property

       

Returns a list of words related to the specified word or phrase. The list is returned as an array of strings. Read-only Variant.

expression.RelatedWordList

expression   Required. An expression that returns a SynonymInfo object.

Example

This example checks to see whether any related words were found for the third word in the active document. If so, the meanings are displayed in a series of message boxes. If there are no related words found, this is stated in a message box.

Set synInfo = ActiveDocument.Words(3).SynonymInfo
If synInfo.Found = True Then
    relList = synInfo.RelatedWordList
    If UBound(relList) <> 0 Then
        For intCount = 1 To UBound(relList)
            Msgbox relList(intCount)
        Next intCount
    Else
        Msgbox "There were no related words found."
    End If
End If