StructuredDocumentTagRangeStart

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.

public class StructuredDocumentTagRangeStart : Node, IEnumerable<Node>, IStructuredDocumentTag

Constructors

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

Properties

NameDescription
Appearance { get; set; }Gets or sets the appearance of the structured document tag.
Color { get; set; }Gets or sets the color of the structured document tag.
CustomNodeId { get; set; }Specifies custom node identifier.
virtual Document { get; }Gets the document to which this node belongs.
Id { get; }Specifies a unique read-only persistent numerical Id for this structured document tag.
virtual IsComposite { get; }Returns true if this node can contain other nodes.
IsShowingPlaceholderText { get; set; }Specifies 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).
LastChild { get; }Gets the last child in the stdContent range.
Level { get; }Gets the level at which this structured document tag range start occurs in the document tree.
LockContentControl { get; set; }When set to true, this property will prohibit a user from deleting this structured document tag.
LockContents { get; set; }When set to true, this property will prohibit a user from editing the contents of this structured document tag.
NextSibling { get; }Gets the node immediately following this node.
override NodeType { get; }Returns StructuredDocumentTagRangeStart.
ParentNode { get; }Gets the immediate parent of this node.
Placeholder { get; }Gets 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 XmlMapping element or the IsShowingPlaceholderText element is true.
PlaceholderName { get; set; }Gets or sets Name of the BuildingBlock containing placeholder text.
PreviousSibling { get; }Gets the node immediately preceding this node.
Range { get; }Returns a Range object that represents the portion of a document that is contained in this node.
RangeEnd { get; }Specifies end of range if the StructuredDocumentTag is a ranged structured document tag. Otherwise returns null.
SdtType { get; }Gets type of this structured document tag.
Tag { get; set; }Specifies a tag associated with the current structured document tag node. Can not be null.
Title { get; set; }Specifies the friendly name associated with this structured document tag. Can not be null.
WordOpenXML { get; }Gets a string that represents the XML contained within the node in the FlatOpc format.
WordOpenXMLMinimal { get; }Gets a string that represents the XML contained within the node in the FlatOpc format. Unlike the WordOpenXML property, this method generates a stripped-down document that excludes any non-content-related parts.
XmlMapping { get; }Gets 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
override Accept(DocumentVisitor)Accepts a visitor.
AppendChild(Node)Adds the specified node to the end of the stdContent range.
Clone(bool)Creates a duplicate of the node.
GetAncestor(NodeType)Gets the first ancestor of the specified NodeType.
GetAncestor(Type)Gets the first ancestor of the specified object type.
GetChildNodes(NodeType, bool)Returns a live collection of child nodes that match the specified types.
GetEnumerator()Provides support for the for each style iteration over the child nodes of this node.
virtual GetText()Gets the text of this node and of all its children.
NextPreOrder(Node)Gets next node according to the pre-order tree traversal algorithm.
PreviousPreOrder(Node)Gets the previous node according to the pre-order tree traversal algorithm.
Remove()Removes itself from the parent.
RemoveAllChildren()Removes all the nodes between this range start node and the range end node.
RemoveSelfOnly()Removes this range start and appropriate range end nodes of the structured document tag, but keeps its content inside the document tree.
ToString(SaveFormat)Exports the content of the node into a string in the specified format.
ToString(SaveOptions)Exports the content of the node into a string using the specified save options.

Remarks

Can be immediate child of Body node only.

Examples

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

Document doc = new Document(MyDir + "Multi-section structured document tags.docx");

StructuredDocumentTagRangeStart rangeStartTag =
    doc.GetChildNodes(NodeType.StructuredDocumentTagRangeStart, true)[0] as StructuredDocumentTagRangeStart;
StructuredDocumentTagRangeEnd rangeEndTag =
    doc.GetChildNodes(NodeType.StructuredDocumentTagRangeEnd, true)[0] as StructuredDocumentTagRangeEnd;

Console.WriteLine("StructuredDocumentTagRangeStart values:");
Console.WriteLine($"\t|Id: {rangeStartTag.Id}");
Console.WriteLine($"\t|Title: {rangeStartTag.Title}");
Console.WriteLine($"\t|PlaceholderName: {rangeStartTag.PlaceholderName}");
Console.WriteLine($"\t|IsShowingPlaceholderText: {rangeStartTag.IsShowingPlaceholderText}");
Console.WriteLine($"\t|LockContentControl: {rangeStartTag.LockContentControl}");
Console.WriteLine($"\t|LockContents: {rangeStartTag.LockContents}");
Console.WriteLine($"\t|Level: {rangeStartTag.Level}");
Console.WriteLine($"\t|NodeType: {rangeStartTag.NodeType}");
Console.WriteLine($"\t|RangeEnd: {rangeStartTag.RangeEnd}");
Console.WriteLine($"\t|Color: {rangeStartTag.Color.ToArgb()}");
Console.WriteLine($"\t|SdtType: {rangeStartTag.SdtType}");
Console.WriteLine($"\t|FlatOpcContent: {rangeStartTag.WordOpenXML}");
Console.WriteLine($"\t|Tag: {rangeStartTag.Tag}\n");

Console.WriteLine("StructuredDocumentTagRangeEnd values:");
Console.WriteLine($"\t|Id: {rangeEndTag.Id}");
Console.WriteLine($"\t|NodeType: {rangeEndTag.NodeType}");

See Also