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();
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("This is just a sample text. Nothing special.");
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "GetElement.docx");
builder.CloseFile();

Resulting document