Zur Startseite

JRSpellChecker

Zur Homepage

GetSynonyms(ByVal word As String, ByVal Synonyms As Variant) As Boolean

Funktion:

gibt eine Liste mit synonymen (gleiche Bedeutung) zu einem Wort zurück.

Achtung! Diese Funktion liefert nur einen Wert zurück, wenn das MS-Word Wörterbuch verwendet wird. Nicht für alle Wörter werden synonyme zurückgeliefert.

         

ico_syntax Syntax:

JRSpell1.GetSynonyms xWord, xSynonyms

xWord

Wort für welches Synonyme gesucht werden.

xSynonyms

Wortliste die zurückgegeben wird.

         

ico_weitere Rückgabewert:


True wenn synonyme gefunden wurden.

löst kein Event aus.

Beispiel:

    Private Sub RichTextBox1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    If RichTextBox1.SelLength = 0 Then Exit Sub
    Dim ref As String
    Dim alternativ As Variant
    Dim n As Integer

    'not supported if lokal wordbook is active
    If JRSpell1.UsedWordbook = LokalWordBook Then Exit Sub

    startsel = RichTextBox1.SelStart
    ref$ = Mid$(RichTextBox1.Text, startsel + 1, RichTextBox1.SelLength)

    If Right$(ref$, 1) = " " Then
      RichTextBox1.SelLength = RichTextBox1.SelLength - 1
    End If

    List1(0).Clear
    List1(1).Clear
    List1(2).Clear

    If JRSpell1.GetMeanings(ref$, alternativ) Then
      For n = 0 To UBound(alternativ)
          If alternativ(n) <> "" Then List1(0).AddItem alternativ(n)
      Next n
    End If

    If JRSpell1.GetSynonyms(ref$, alternativ) Then
      For n = 0 To UBound(alternativ)
          If alternativ(n) <> "" Then List1(1).AddItem alternativ(n)
      Next n
    End If

    If JRSpell1.GetAnagrams(ref$, alternativ) Then
      For n = 0 To UBound(alternativ)
          If alternativ(n) <> "" Then List1(2).AddItem alternativ(n)
      Next n
    End If

    If JRSpell1.GetAntonyms(ref$, alternativ) Then
      For n = 0 To UBound(alternativ)
        If alternativ(n) <> "" Then List1(3).AddItem alternativ(n)
      Next n
    End If
    End Sub