ApplicationFieldCollection Object
Description
Contains all created or imported Microsoft Word fields represented through objects of the type ApplicationField.
Syntax
ApplicationFieldCollectionExamples
The following example demonstrates ApplicationFieldCollection in a practical document-editing workflow. It contains all created or imported Microsoft Word fields represented through objects of the type ApplicationField.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const applicationFields = mainText.applicationFields;
applicationFields.getItem(
function(field) {
if (!field) {
console.warn("No application field was returned.");
return;
}
console.log("get item result:", field);
},
onTxError
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Inserts a new application field at the current input position. |
| getCanAdd | Gets a value indicating whether a new text field can be inserted at the current input position. (Inherited from TextFieldCollectionBase.) |
| getItem | Gets the field at the current input position or null, if there is no such field at the current input position. |
| remove | Removes a field of the type ApplicationField from a TX Text Control document. The visible text is deleted depending on the keepText parameter. |