VSSpell Control > VSSpell All Members > VSSpell Events > BadWord Event (VSSpell) |
Fired when a bad word is encountered during a spell check.
Private Sub VSSpell_BadWord(Problem As Integer)
If suggestions are generated for the bad word, the BadWord event is fired after the final Suggestion event is fired. The problem parameter indicates the type of problem that caused the word to be bad. Currently, NOTINDICT is the only problem supported by the BadWord event.
When handling the BadWord event, you may retrieve the offending word from the Text property using the SelStart and SelLength properties, or read it directly from the CheckWord property. For example:
Example Title |
Copy Code
|
---|---|
Private Sub VSSpell1_BadWord(Problem As Integer) With VSSpell1 Debug.Print "BadWord: "; Mid(.Text, .SelStart + 1, .SelLength) Debug.Print "BadWord: "; .CheckWord End With End Sub |