Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function Synonyms()
' This works on single word selections so you will need to modify your range to select individual words and loop something similar to this across each word in the range.
' Andrew Lockton Chrysalis Design Pty Limited Melbourne Australia
Dim mysInfo, myRelList, sList As String, i As Integer
Set mysInfo = Selection.Range.SynonymInfo
If mysInfo.Found = True Then
    myRelList = mysInfo.SynonymList(Meaning:=1) 'RelatedExpressionList
    If UBound(myRelList) <> 0 Then
        For i = 1 To UBound(myRelList)
            sList = sList & ", " & myRelList(i)
        Next i
        sList = Right(sList, (Len(sList) - 2)) 'remove extra comma
        MsgBox "Synonyms are:" & vbCr & sList
    Else
        MsgBox "There were no related expressions found."
    End If
End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function Synonyms()
' This works on single word selections so you will need to modify your range to select individual words and loop something similar to this across each word in the range.
' Andrew Lockton Chrysalis Design Pty Limited Melbourne Australia
Dim mysInfo, myRelList, sList As String, i As Integer
Set mysInfo = Selection.Range.SynonymInfo
If mysInfo.Found = True Then
    myRelList = mysInfo.SynonymList(Meaning:=1) 'RelatedExpressionList
    If UBound(myRelList) <> 0 Then
        For i = 1 To UBound(myRelList)
            sList = sList & ", " & myRelList(i)
        Next i
        sList = Right(sList, (Len(sList) - 2)) 'remove extra comma
        MsgBox "Synonyms are:" & vbCr & sList
    Else
        MsgBox "There were no related expressions found."
    End If
End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1