StructuredDocumentTagCollection class

StructuredDocumentTagCollection class

A collection of IStructuredDocumentTag instances that represent the structured document tags in the specified range. To learn more, visit the Structured Document Tags or Content Control documentation article.

Properties

NameDescription
countReturns the number of structured document tags in the collection.
this[]

Methods

NameDescription
getById(id)Returns the structured document tag by identifier.
getByTag(tag)Returns the first structured document tag encountered in the collection with the specified tag.
getByTitle(title)Returns the first structured document tag encountered in the collection with the specified title.
remove(id)Removes the structured document tag with the specified identifier.
removeAt(index)Removes a structured document tag at the specified index.

Examples

Shows how to get structured document tag.

let doc = new aw.Document(base.myDir + "Structured document tags by id.docx");

// Get the structured document tag by Id.
let sdt = doc.range.structuredDocumentTags.getById(1160505028);
console.log(sdt.isMultiSection);
console.log(sdt.title);

// Get the structured document tag or ranged tag by Title.
sdt = doc.range.structuredDocumentTags.getByTitle("Alias4");
console.log(sdt.id);

See Also