RelatedExpressionList Property Example

This example checks to see whether any related expressions were found for the selection. If so, the meanings are displayed in a series of message boxes. If none were found, this is stated in a message box.

Set mySinfo = Selection.Range.SynonymInfo
If mySinfo.Found = True Then
    myRelList = mysInfo.RelatedExpressionList
    If UBound(myRelList) <> 0 Then
        For i = 1 To UBound(myRelList)
            Msgbox myRelList(i)
        Next i
    Else
        Msgbox "There were no related expressions found."
    End If
End If