PartOfSpeechList 属性

       

返回某一单词或短语在同义词库中查找到的对应于其含义的词类的列表。此列表以整数数组形式返回。Variant 类型,只读。

expression.PartOfSpeechList

expression   必需。该表达式返回一个 SynonymInfo 对象。

说明

词类列表以数组形式返回,该数组由下列 WdPartOfSpeech 常量组成:wdAdjectivewdAdverbwdConjunctionwdIdiomwdInterjectionwdNounwdOtherwdPrepositionwdPronounwdVerb。该数组的元素将按照 MeaningList 属性返回的元素顺序进行排列。

示例

本示例检查在同义词库中是否找到有关所选内容的含义。如果有,则在一组信息框中显示这些含义及相应的词类。

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
Else
    MsgBox "There were no meanings found."
End If