#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Thesarus

Hia!

How are you doing friends?

Some help please!!!

I type 'Some' into A1; Then I select Thesarus to see a list of similar
words; I like to get them into an array.

Is it possible at all?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Thesarus

Following gets 'some' results but nothing like the extensive list returned
with Shift F7 in Word. Maybe there's a different way!

Option Explicit
Private mObjWord As Object

Sub test()
Dim i As Long
Dim sWord As String
Dim arr

sWord = "some"

If GetMeanings(sWord, arr) Then
For i = LBound(arr) To UBound(arr)
Debug.Print arr(i)
Next

End If

' call AllDone ' when done

End Sub

Sub AllDone()
Set mObjWord = Nothing
End Sub

Function GetMeanings(myWord As String, vMeanings)
Dim objSynonymInfo As Object

If mObjWord Is Nothing Then
Set mObjWord = CreateObject("word.application")
End If

Set objSynonymInfo = mObjWord.SynonymInfo(myWord)

vMeanings = objSynonymInfo.MeaningList

GetMeanings = UBound(vMeanings) 0

Exit Function
errExit:

End Function


Don't forget to clean up the Word object when done

Regards,
Peter T


"Nedan Nedzatra" wrote in message
...
Hia!

How are you doing friends?

Some help please!!!

I type 'Some' into A1; Then I select Thesarus to see a list of similar
words; I like to get them into an array.

Is it possible at all?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Thesarus

Can indeed get more info -
Add the Word reference (Tools References, Microsoft Word)

change
Dim objSynonymInfo As Object

to
Dim objSynonymInfo As Word.SynonymInfo

Select "SynonymInfo" and press F1 to get Word VBA help. Look at the examples
with
..MeaningList .PartOfSpeechList .RelatedWordList .RelatedExpressionList

Note too the language option with SynonymInfo

If you want to set back to Early Binding (without the reference to Word),
beforehand convert any named constants you see in the examples to their
intrinsic values. In the Immediate window type (say)
?wdAdverb

and hit enter (wdAdverb = 2)

Regards,
Peter T


"Peter T" <peter_t@discussions wrote in message
...
Following gets 'some' results but nothing like the extensive list returned
with Shift F7 in Word. Maybe there's a different way!

Option Explicit
Private mObjWord As Object

Sub test()
Dim i As Long
Dim sWord As String
Dim arr

sWord = "some"

If GetMeanings(sWord, arr) Then
For i = LBound(arr) To UBound(arr)
Debug.Print arr(i)
Next

End If

' call AllDone ' when done

End Sub

Sub AllDone()
Set mObjWord = Nothing
End Sub

Function GetMeanings(myWord As String, vMeanings)
Dim objSynonymInfo As Object

If mObjWord Is Nothing Then
Set mObjWord = CreateObject("word.application")
End If

Set objSynonymInfo = mObjWord.SynonymInfo(myWord)

vMeanings = objSynonymInfo.MeaningList

GetMeanings = UBound(vMeanings) 0

Exit Function
errExit:

End Function


Don't forget to clean up the Word object when done

Regards,
Peter T


"Nedan Nedzatra" wrote in
message ...
Hia!

How are you doing friends?

Some help please!!!

I type 'Some' into A1; Then I select Thesarus to see a list of similar
words; I like to get them into an array.

Is it possible at all?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Thesarus

Brilliant.

Thank You.

"Peter T" wrote:

Following gets 'some' results but nothing like the extensive list returned
with Shift F7 in Word. Maybe there's a different way!

Option Explicit
Private mObjWord As Object

Sub test()
Dim i As Long
Dim sWord As String
Dim arr

sWord = "some"

If GetMeanings(sWord, arr) Then
For i = LBound(arr) To UBound(arr)
Debug.Print arr(i)
Next

End If

' call AllDone ' when done

End Sub

Sub AllDone()
Set mObjWord = Nothing
End Sub

Function GetMeanings(myWord As String, vMeanings)
Dim objSynonymInfo As Object

If mObjWord Is Nothing Then
Set mObjWord = CreateObject("word.application")
End If

Set objSynonymInfo = mObjWord.SynonymInfo(myWord)

vMeanings = objSynonymInfo.MeaningList

GetMeanings = UBound(vMeanings) 0

Exit Function
errExit:

End Function


Don't forget to clean up the Word object when done

Regards,
Peter T


"Nedan Nedzatra" wrote in message
...
Hia!

How are you doing friends?

Some help please!!!

I type 'Some' into A1; Then I select Thesarus to see a list of similar
words; I like to get them into an array.

Is it possible at all?



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Thesarus

Brilliant.

Thank You.

"Peter T" wrote:

Following gets 'some' results but nothing like the extensive list returned
with Shift F7 in Word. Maybe there's a different way!

Option Explicit
Private mObjWord As Object

Sub test()
Dim i As Long
Dim sWord As String
Dim arr

sWord = "some"

If GetMeanings(sWord, arr) Then
For i = LBound(arr) To UBound(arr)
Debug.Print arr(i)
Next

End If

' call AllDone ' when done

End Sub

Sub AllDone()
Set mObjWord = Nothing
End Sub

Function GetMeanings(myWord As String, vMeanings)
Dim objSynonymInfo As Object

If mObjWord Is Nothing Then
Set mObjWord = CreateObject("word.application")
End If

Set objSynonymInfo = mObjWord.SynonymInfo(myWord)

vMeanings = objSynonymInfo.MeaningList

GetMeanings = UBound(vMeanings) 0

Exit Function
errExit:

End Function


Don't forget to clean up the Word object when done

Regards,
Peter T


"Nedan Nedzatra" wrote in message
...
Hia!

How are you doing friends?

Some help please!!!

I type 'Some' into A1; Then I select Thesarus to see a list of similar
words; I like to get them into an array.

Is it possible at all?



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"