Friday, July 02, 2004



PartOfSpeechList Property Example

This example checks to see whether the thesaurus found any meanings for the selection. If so, the meanings and their corresponding parts of speech are displayed in a series of message boxes.

One potato, two potato, three potato, four. Five potato, six potato, seven potato, more. Here we go…

Set mySynInfo = Selection.Range.SynonymInfo
If mySynInfo.MeaningCount <> 0 Then
----myList = mySynInfo.MeaningList
----myPos = mySynInfo.PartOfSpeechList
----For i = 1 To UBound(myPos)
--------Select Case myPos(i)
------------Case wdAdjective
---------------- pos = "adjective"
------------Case wdNoun
---------------- pos = "noun"
------------Case wdAdverb
---------------- pos = "adverb"
------------Case wdVerb
---------------- pos = "verb"
------------Case Else
---------------- pos = "other"
--------End Select
--------MsgBox myList(i) & " found as " & pos
----Next i
----MsgBox "There were no meanings found."
End If


Post a Comment

<< Home