Ohh Gott... tausend Dank!! Ich hatte das auch schon geändert, aber in "wd.German" statt "WdLanguageID.wdGerman" und dabei wurden bloß "noun" "verb" etc ausgegeben.
Warum braucht man den Part "WdLanguageID."? Aber auf jedenfall schonmal vielen vielen Dank!!
Eine Weitere Frage, nachfolgend nochmal der Code
Public Sub PartsOfSpeech()
Dim mObjWord As Word.Application
Dim mySynInfo As Word.SynonymInfo
Dim myList As Variant
Dim myPos As Variant
Dim i As Integer
Dim iMax As Integer
Dim thisPos As String
Dim oCell As Range
Set mObjWord = CreateObject("Word.Application")
iMax = 1
For Each oCell In Selection
oCell.Offset(0, 1).Resize(1, 99).ClearContents
If oCell.Column = 1 And Not IsEmpty(oCell) Then
Set mySynInfo = SynonymInfo(Word:=oCell.Value, LanguageID:=WdLanguageID.wdGerman)
oCell.Offset(0, 1) = "'(" & CStr(mySynInfo.MeaningCount) & ")"
If mySynInfo.MeaningCount <> 0 Then
myList = mySynInfo.MeaningList
myPos = mySynInfo.PartOfSpeechList
If i > iMax Then iMax = i
For i = 1 To UBound(myPos)
Select Case myPos(i)
Case wdAdjective
thisPos = "adjective"
Case wdNoun
thisPos = "noun"
Case wdAdverb
thisPos = "adverb"
Case wdVerb
thisPos = "verb"
Case wdConjunction
thisPos = "conjunction"
Case wdIdiom
thisPos = "idiom"
Case wdInterjection
thisPos = "interjection"
Case wdPreposition
thisPos = "preposition"
Case wdPronoun
thisPos = "pronoun"
Case Else
thisPos = "other"
End Select
oCell.Offset(0, i + 1) = myList(i) & " (" & thisPos & ")"
Next i
Else
oCell.Offset(0, 2) = "No meanings found"
End If
End If
Next oCell
For i = 3 To iMax
Columns(i).EntireColumn.AutoFit
Next i
End Sub
wenn ich da jetztfolgenden Teil rausnehme
If mySynInfo.MeaningCount <> 0 Then
myList = mySynInfo.MeaningList
myPos = mySynInfo.PartOfSpeechList
If i > iMax Then iMax = i
For i = 1 To UBound(myPos)
Select Case myPos(i)
Case wdAdjective
thisPos = "adjective"
Case wdNoun
thisPos = "noun"
Case wdAdverb
thisPos = "adverb"
Case wdVerb
thisPos = "verb"
Case wdConjunction
thisPos = "conjunction"
Case wdIdiom
thisPos = "idiom"
Case wdInterjection
thisPos = "interjection"
Case wdPreposition
thisPos = "preposition"
Case wdPronoun
thisPos = "pronoun"
Case Else
thisPos = "other"
End Select
oCell.Offset(0, i + 1) = myList(i) & " (" & thisPos & ")"
Next i
Erledigt sich dann damit der POS teil mit der Zuteilung zu "noun" "verb" etc. oder habe ich noch was übersehen?
Und noch eine Frage, jetzt gibt der Code ja Meanings wieder, also in welchem Sinne die Wörter gebraucht werden können.
Wände |
(3) |
Auswinden (verb) |
Rollen (verb) |
Begrenzungen (noun) |
Gibt es eine Möglichkeit sich nicht die Bedeutung ausgeben zu lassen, sondern Wortalternativen?
Wände |
Begrenzungen |
Abgründe |
Mauern |
Also die Wörter, die unter den Bedeutungen aufgeführt sind?
Vielen Dank im Vorraus!
|