MisspelledWordCollection Object
Description
The MisspelledWordCollection contains all misspelled words in the main part of a Text Control document.
Syntax
MisspelledWordCollectionExamples
The following example demonstrates MisspelledWordCollection in a practical document-editing workflow. The MisspelledWordCollection contains all misspelled words in the main part of a Text Control document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectMisspelledWordCollection(misspelledWords) {
misspelledWords.getCountOf(
TXTextControl.MisspelledWordKind.All,
function(result) {
console.log("get count of result:", result);
},
onTxError
);
}Members
Methods
| Method | Description |
|---|---|
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getCountOf | Gets the number of misspelled words with a special meaning from the collection. |
| getItemAtInputPosition | Gets the misspelled word of the specified kind at the current text input position. If there is no misspelled word, the next possible word of is returned. If there is no misspelled word of the specified kind between the current input position and the end of the text, the first word of the specified kind is returned. |
| getItemAtLocation | Gets the misspelled word at a certain geometrical location. If there is no misspelled word, null is returned. |
| getItemAtTextPosition | Gets the misspelled word of the specified kind at the specified text input position. If there is no misspelled word, the next possible word is returned. If there is no misspelled word of the specified kind between the specified input position and the end of the text, the first word of the specified kind is returned. |
| ignore | Changes the text of the specified misspelled word and marks it as ignored. Ignored misspelled words are not underlined with a red zigzag line. |
| remove | Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text. |