DS Server

MisspelledWord Object

Object|Introduced in 28.0

Description

The MisspelledWord object represents a misspelled word in a document's text.

Syntax

MisspelledWord

Examples

The following example demonstrates MisspelledWord in a practical document-editing workflow. The MisspelledWord object represents a misspelled word in a document's text.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectMisspelledWord(misspelledWord) {
    misspelledWord.getText(
        function(result) {
            console.log("get text result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getIsDuplicateGets a value which marks the misspelled word as duplicate.
getIsIgnoredGets a value which marks the misspelled word as ignored. An ignored misspelled word remains in the collection of misspelled words, but it is not underlined in the text with a red zigzag line
getLengthGets the length of a misspelled word.
getNumberGets the number of this misspelled word. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.
getStartGets the starting position of a misspelled word. It is a one-based index of the word's first character.
getTextGets the text of the misspelled word.
selectSelects the misspelled word in the text.
setIsDuplicateSets a value which marks the misspelled word as duplicate. A duplicate word is not misspelled, but it has the same text as the word in front of it.
setIsIgnoredSets a value which marks the misspelled word as ignored. An ignored misspelled word remains in the collection of misspelled words, but it is not underlined in the text with a red zigzag line.