GetElement
Get the element by its position in the document.
Returns:
- Type
-
DocumentElement
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oSection = oDocument.GetFinalSection();
oDocContent = oSection.GetHeader("default", true);
oParagraph = oDocContent.GetElement(0);
oParagraph.AddText("This is the text in the default header");
builder.SaveFile("docx", "GetElement.docx");
builder.CloseFile();
Resulting document