Range is defined to contain only the word just parsed out. The SpellingErrors method returns a collection of misspelled words. If this collection contains more that zero words we move on. A call to the GetSpellingSuggestions method, passing in the incorrectly spelled word, fills a SpellingSuggestions collection of suggested replacement words.
We pass this collection to the SpellCheck form. That is the second form in our project.
To add a new form to a project use File|New Form. Let it have the 'frSpellCheck' name. Add three TBitBtn components on this form. Two EditBox-es and one ListBox. Note the three more Labels. The "Not in dictionary" label is "connected" with the edNID edit box. The edNID simply display the misspelled word. The lbSuggestions list box will list the items in SpellingSuggestions collection. The selected spelling suggestion is placed in the edReplaceWith edit box.
The three BitButtons are used to Cancel the spell checking, Ignore the current word and to Change the misspelled word with the one in the edReplaceWith edit box. The BitBtn components ModalResult property is used when referring to what the user has clicked. The "Ignore" button has its ModalResult property set to mrIgnore, "Change" to mrOk and "Cancel" to mrAbort.
The frSpellCheck has one Public string variable called sReplacedWord. This variable returns the text in the edReplaceWith when the user presses the "Change" button.


