Get Started
Usage API

GetElement

GetElement() → { DocumentElement }

Get the element by its position in the document.

Parameters:

This method doesn't have any parameters.

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