GetByTitle

StructuredDocumentTagCollection.GetByTitle method

Returns the first structured document tag encountered in the collection with the specified title.

public IStructuredDocumentTag GetByTitle(string title)
ParameterTypeDescription
titleStringThe title of structured document tag.

Remarks

Returns null if the structured document tag with the specified title cannot be found.

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