Recently, we released the Visual Basic 6 version of our spell checking component TX Spell .NET. This ActiveX Package gives you all the power and functionality of TX Spell .NET in a Visual Basic 6 compatible form.
We have added specific methods and properties that are fully compatible to Visual Basic 6 and other Win32 IDEs such as Delphi or Access. AxTXSpell contains 4 classes:
The AxTXSpellChecker class implements a component with spell checking features.
The class IncorrectWord represents a misspelled word and provides properties such as the start index or length.
The OpenOfficeDictionary class represents a dictionary which gets its content from a Hunspell Open Source dictionary.
The UserDictionary class represents a dictionary that allows you to use, create and edit your own dictionaries.
In order to load an existing user dictionary, a new UserDictionary object must be created. By specifying the DictionaryPath, an existing dictionary can be loaded. Finally, the new created dictionary must be added to the AxTXSpellChecker instance using AddUserDictionary.
Dim UserDic As AxTXSpell.UserDictionary Set UserDic = New UserDictionary UserDic.DictionaryPath = "c:\en_US_Legal.txd" TXSpell1.AddUserDictionary UserDic
Now, the user dictionary is automatically used to spell check the document. You can easily add new words to the dictionary by using the AddWord method. These changes can be preserved by saving the dictionary with the Save method:
UserDic.AddWord "TXTextControl" UserDic.Save "c:\en_US_Legal.txd"