StructuredDocumentTagRangeStart class

StructuredDocumentTagRangeStart class

Represents a start of ranged structured document tag which accepts multi-sections content. See also StructuredDocumentTagRangeEnd. To learn more, visit the Structured Document Tags or Content Control documentation article.

Remarks

Can be immediate child of Body node only.

Inheritance: StructuredDocumentTagRangeStartNode

Interfaces: IStructuredDocumentTag

Constructors

NameDescription
StructuredDocumentTagRangeStart(doc, type)Initializes a new instance of the Structured document tag range start class.

Properties

NameDescription
appearanceGets or sets the appearance of the structured document tag.
colorGets or sets the color of the structured document tag.
custom_node_idSpecifies custom node identifier.
(Inherited from Node)
documentGets the document to which this node belongs.
(Inherited from Node)
idSpecifies a unique read-only persistent numerical Id for this structured document tag.
is_compositeReturns True if this node can contain other nodes.
(Inherited from Node)
is_multi_sectionReturns true if this instance is a ranged (multi-section) structured document tag.
(Inherited from IStructuredDocumentTag)
is_showing_placeholder_textSpecifies whether the content of this structured document tag shall be interpreted to contain placeholder text (as opposed to regular text contents within the structured document tag).
last_childGets the last child in the stdContent range.
levelGets the level at which this structured document tag range start occurs in the document tree.
lock_content_controlWhen set to True, this property will prohibit a user from deleting this structured document tag.
lock_contentsWhen set to True, this property will prohibit a user from editing the contents of this structured document tag.
next_siblingGets the node immediately following this node.
(Inherited from Node)
nodeReturns Node object that implements this interface.
(Inherited from IStructuredDocumentTag)
node_typeReturns NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START.
parent_nodeGets the immediate parent of this node.
(Inherited from Node)
placeholderGets the BuildingBlock containing placeholder text which should be displayed when this structured document tag run contents are empty, the associated mapped XML element is empty as specified via the StructuredDocumentTagRangeStart.xml_mapping element or the StructuredDocumentTagRangeStart.is_showing_placeholder_text element is True.
placeholder_nameGets or sets Name of the BuildingBlock containing placeholder text.
previous_siblingGets the node immediately preceding this node.
(Inherited from Node)
rangeReturns a Range object that represents the portion of a document that is contained in this node.
(Inherited from Node)
range_endSpecifies end of range if the StructuredDocumentTag is a ranged structured document tag. Otherwise returns None.
sdt_typeGets type of this structured document tag.
tagSpecifies a tag associated with the current structured document tag node. Can not be None.
titleSpecifies the friendly name associated with this structured document tag. Can not be None.
word_open_xmlGets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format.
word_open_xml_minimalGets a string that represents the XML contained within the node in the SaveFormat.FLAT_OPC format.
xml_mappingGets an object that represents the mapping of this structured document tag range to XML data in a custom XML part of the current document.

Methods

NameDescription
accept(visitor)Accepts a visitor.
append_child(new_child)Adds the specified node to the end of the stdContent range.
clone(is_clone_children)Creates a duplicate of the node.
(Inherited from Node)
get_ancestor(ancestor_type)Gets the first ancestor of the specified object type.
(Inherited from Node)
get_ancestor(ancestor_type)Gets the first ancestor of the specified NodeType.
(Inherited from Node)
get_child_nodes(node_type, is_deep)Returns a live collection of child nodes that match the specified types.
get_text()Gets the text of this node and of all its children.
(Inherited from Node)
is_ranged()Returns true if this instance is a ranged structured document tag.
(Inherited from IStructuredDocumentTag)
next_pre_order(root_node)Gets next node according to the pre-order tree traversal algorithm.
(Inherited from Node)
node_type_to_string(node_type)A utility method that converts a node type enum value into a user friendly string.
(Inherited from Node)
previous_pre_order(root_node)Gets the previous node according to the pre-order tree traversal algorithm.
(Inherited from Node)
remove()Removes itself from the parent.
(Inherited from Node)
remove_all_children()Removes all the nodes between this range start node and the range end node.
remove_self_only()Removes this range start and appropriate range end nodes of the structured document tag, but keeps its content inside the document tree.
structured_document_tag_node()Returns Node object that implements this interface.
(Inherited from IStructuredDocumentTag)
to_string(save_format)Exports the content of the node into a string in the specified format.
(Inherited from Node)
to_string(save_options)Exports the content of the node into a string using the specified save options.
(Inherited from Node)

Examples

Shows how to get the properties of multi-section structured document tags.

doc = aw.Document(MY_DIR + "Multi-section structured document tags.docx")

range_start_tag = doc.get_child_nodes(aw.NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, True)[0].as_structured_document_tag_range_start()
range_end_tag = doc.get_child_nodes(aw.NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END, True)[0].as_structured_document_tag_range_end()


print("StructuredDocumentTagRangeStart values:")
print(f"\t|id: {range_start_tag.id}")
print(f"\t|title: {range_start_tag.title}")
print(f"\t|placeholder_name: {range_start_tag.placeholder_name}")
print(f"\t|is_showing_placeholder_text: {range_start_tag.is_showing_placeholder_text}")
print(f"\t|lock_content_control: {range_start_tag.lock_content_control}")
print(f"\t|lock_contents: {range_start_tag.lock_contents}")
print(f"\t|level: {range_start_tag.level}")
print(f"\t|node_type: {range_start_tag.node_type}")
print(f"\t|range_end: {range_start_tag.range_end}")
print(f"\t|color: {range_start_tag.color.to_argb()}")
print(f"\t|sdt_type: {range_start_tag.sdt_type}")
print(f"\t|flat_opc_content: {range_start_tag.word_open_xml}")
print(f"\t|tag: {range_start_tag.tag}\n")

print("StructuredDocumentTagRangeEnd values:")
print(f"\t|id: {range_end_tag.id}")
print(f"\t|node_type: {range_end_tag.node_type}")

See Also