DocumentLinkCollection Object
Description
The DocumentLinkCollection contains a collection of document links.
Syntax
DocumentLinkCollectionExamples
The following example demonstrates DocumentLinkCollection in a practical document-editing workflow. The DocumentLinkCollection contains a collection of document links .
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const documentLinks = mainText.documentLinks;
documentLinks.getItem(
function(result) {
if (!result) {
console.warn("No document link was returned.");
return;
}
console.log("get item result:", result);
},
onTxError,
25
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Adds a new document link to the collection. |
| clear | Removes all document links from the collection. |
| 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.) |
| getItem | Gets the document link at the current text input position or the document link with the specified id. |
| remove | Removes the link from the collection. |