Wintertree Software Inc.

WSpell ActiveX Spell Checker for Visual Basic

Home Site index Contact us Catalog Shopping Cart Products Support Search

You are here: Home > Add a spell checker to your applications > Visual Basic > Using WSpell > How to check spelling of a string non-interactively


How to check the spelling of a string non-interactively

To check the spelling of a string without having WSpell interact with the user, or to check spelling using your own user interface, perform the steps listed below.

  1. Set WSpell's Text property with the value of the string you want to check.

  2. Set the ShowDialog property to False. This will prevent the built-in spelling dialog box from appearing.

  3. Call the Start method to begin checking.

  4. Call the Resume method in a loop until the EndOfText Event is fired. WSpell will check the spelling of each word in the text, and will fire events as misspelled words are detected and the text is changed (see below).

  5. Obtain the corrected text from the Text property.

Here's an example showing how to do this:

Private endOfTextFired As Boolean
Private Sub SpellCheckButton_Click()
Dim rslt As Integer
' Check the contents of theString
WSpell1.Text = theString
WSpell1.ShowDialog = False
endOfTextFired = False
rslt = WSpell1.Start
While (Not endOfTextFired And rslt >= 0)
rslt = WSpell1.Resume
Wend
End Sub
Private Sub WSpell1_EndOfText()
endOfTextFired = True
End Sub

During checking, WSpell fires certain events to signal the detection of misspelled words and changes to the text. The following events may be fired during a spelling check:

You can add event handlers in your application to respond to these events in some application-specific way. For example, when MisspelledWordEvent is fired, your application might report the misspelling to the user.


Home Site index Contact us Catalog Shopping Cart Products Support Search


Copyright © 2015 Wintertree Software Inc.