Zur Startseite

JRSpellChecker

Zur Homepage

SpellCheckString(ByVal TextToCheck As String, ByVal Startpos As Variant, ByVal Endpos As Variant)

Hinweis: Mit Version2 wurde Startpos und Endpos von Long in Variant geändert.

Funktion:

prüft eine Zeichenfolge ab einer bestimmten Position und liefert die Positionen der fehlerhaften Wörter zurück.

       

ico_syntax   Syntax:

JRSpell1.SpellCheckString xText, startpos, endpos

xText

String der geprüft werden soll.

startpos

endpos

Starten der Prüfung bei Zeichen nr.

prüfen bis Zeichen nr.

       

ico_weitere   Rückgabewert:


startpos


endpos

Event

Startposition des fehlerhaften Wortes.
-1 wenn kein Fehler gefunden wurde.

Endposition des fehlerhaften Wortes.

SpellCheckWord

Beispiel:

    Private Sub Command2_Click()
    'start with check at characterpos 0
    teststart& = 0
    teststring$ = Text1.Text
    findnextincorrectword:
    'the jrspell_spellcheckedword event returns the incorrect word
    'teststart returns the first characterpos of a incorrect word. returns -1 if no incorrect word was found
    'testend returns the last characterpos of a incorrect word

    'check the complete string
    testend& = Len(teststring$)
    x = JRSpell1.SpellCheckString(teststring$, teststart&, testend&)
    'if any incorrect word was found, then search for the next
    If teststart& <> -1 Then
      MsgBox "-->> " + Form1.JRSpell1.SpellInfo_MisspelledWord
      teststart& = testend&
      GoTo findnextincorrectword
    End If
    End Sub