insertStructuredDocumentTag method

insertStructuredDocumentTag(type)

Inserts a StructuredDocumentTag into the document.

insertStructuredDocumentTag(type: Aspose.Words.Markup.SdtType)
ParameterTypeDescription
typeSdtType

Returns

The StructuredDocumentTag node that was just inserted.

Examples

Shows how to simply insert structured document tag.

let doc = new aw.Document(base.myDir + "Rendering.docx");
let builder = new aw.DocumentBuilder(doc);

builder.moveTo(doc.firstSection.body.paragraphs.at(3));
// Note, that only following StructuredDocumentTag types are allowed for insertion:
// SdtType.PlainText, SdtType.RichText, SdtType.Checkbox, SdtType.DropDownList,
// SdtType.ComboBox, SdtType.Picture, SdtType.date.
// Markup level of inserted StructuredDocumentTag will be detected automatically and depends on position being inserted at.
// Added StructuredDocumentTag will inherit paragraph and font formatting from cursor position.
let sdtPlain = builder.insertStructuredDocumentTag(aw.Markup.SdtType.PlainText);

doc.save(base.artifactsDir + "StructuredDocumentTag.insertStructuredDocumentTag.docx");

See Also