FormattedText Object
Description
Represents a part of the document.
Syntax
FormattedTextExamples
The following example demonstrates FormattedText in a practical document-editing workflow. It represents a part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(formattedText) {
formattedText.getTextFieldsByType(
TXTextControl.TextFieldType.ApplicationField,
function(textFields) {
if (!textFields) {
console.warn("No text field info was returned.");
return;
}
console.log("get text fields by type result:", textFields);
},
onTxError
);
}, onTxError);Members
Properties
| Property | Description |
|---|---|
| applicationFields | Gets a collection of all Microsoft Word fields that have been created or imported from a Microsoft Word or RTF document. |
| comments | Gets a collection of all comments in this text part. |
| documentLinks | Gets a collection of all links which point to targets in the same document. |
| documentTargets | Gets a collection of all document targets. |
| editableRegions | Gets a collection of all editable regions. |
| formFields | Gets a collection of all form fields in the text part. |
| frames | Gets a collection of all frames in the document. |
| hypertextLinks | Gets a collection of all hypertext links. |
| lines | Gets a collection of all text lines. |
| misspelledWords | Gets a collection of all misspelled words. |
| paragraphs | Gets a collection of all paragraphs. |
| selection | Gets the current selection. |
| subTextParts | Gets the current subtextparts. |
| tables | Gets a collection of all tables. |
| tablesOfContents | Gets the current tables of contents. |
| textChars | Gets a collection of all text characters. |
| textFields | Gets a collection of all standard text fields. |
| textPartType | Gets the Text part type. Possible values are "mainText", "headerFooter" and "textFrame". |
| trackedChanges | Gets a collection of all tracked changes. |
Methods
| Method | Description |
|---|---|
| find | Finds a text string. The search starts at the specified position. |
| getTextFieldsByType | Returns an array of static text field information objects. |