StructuredDocumentTagCollection

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.

public class StructuredDocumentTagCollection : IEnumerable<IStructuredDocumentTag>

Properties

NameDescription
Count { get; }Returns the number of structured document tags in the collection.
Item { get; }Returns the structured document tag at the specified index.

Methods

NameDescription
GetById(int)Returns the structured document tag by identifier.
GetByTag(string)Returns the first structured document tag encountered in the collection with the specified tag.
GetByTitle(string)Returns the first structured document tag encountered in the collection with the specified title.
GetEnumerator()Returns an enumerator object.
Remove(int)Removes the structured document tag with the specified identifier.
RemoveAt(int)Removes a structured document tag at the specified index.

Examples

Shows how to get structured document tag.

Document doc = new Document(MyDir + "Structured document tags by id.docx");

// Get the structured document tag by Id.
IStructuredDocumentTag sdt = doc.Range.StructuredDocumentTags.GetById(1160505028);
Console.WriteLine(sdt.IsMultiSection);
Console.WriteLine(sdt.Title);

// Get the structured document tag or ranged tag by Title.
sdt = doc.Range.StructuredDocumentTags.GetByTitle("Alias4");
Console.WriteLine(sdt.Id);

See Also