# SpellCheckText Event

> Occurs when altered text must be spell checked: the handler returns an array of one-based start and end positions of misspelled words to underline.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Event
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > SpellCheckText Event
- **293 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/spellchecktext-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/spellchecktext-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/spellchecktext-event/llms-full.txt

---

Occurs, if the document's text has been altered and the spelling of the new text must be checked. This event occurs only, if the [EnableSpellChecking](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/enablespellchecking-property/llms-full.txt) property has been set to true.

Introduced: 16.0.

### Syntax

```vbscript
SpellCheckText(Text, MisspelledWordPositions)
```

### Parameters

| Parameter | Description |
|---|---|
| Text | Is the text to check. |
| MisspelledWordPositions | Is an array of Long values which can be used to inform the TextControl about misspelled words. This array must be created in the event handler after the specified text has been examined. The array must contain two entries for each misspelled word: a start position and an end position. Both values must be one-based indices in the specified text. The example text 'This iss an exxample' contains two misspelled words: 'iss' and 'exxample'. For this example an array of four Long values must be created containing the values 6, 8, 13, 20. TextControl uses these positions to underline the misspelled words with a red zigzag line. |

### Data Types

| Name | Data type |
|---|---|
| Text | String |
| MisspelledWordPositions | Array of Long |

### See Also

- [Programming Category: Spell Checking](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/spell-checking/llms-full.txt)

---

## Nearby

- **Previous:** [SizeMode Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/sizemode-property/llms-full.txt)
- **Next:** [StartUndoAction Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/startundoaction-method/llms-full.txt)
