GetById

StructuredDocumentTagCollection.GetById method

Returns the structured document tag by identifier.

public IStructuredDocumentTag GetById(int id)
ParameterTypeDescription
idInt32The structured document tag identifier.

Remarks

Returns null if the structured document tag with the specified identifier 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