GetElement
Returns an element by its position in the document.
Syntax
expression.GetElement(nPos);
expression
- A variable that represents a ApiDocumentContent class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
nPos | Required | number | The element position that will be taken from the document. |
Returns
Example
This example shows how to get an element by its position in the document content.
let doc = Api.GetDocument();
let section = doc.GetFinalSection();
let docContent = section.GetHeader("default", true);
let paragraph = docContent.GetElement(0);
paragraph.AddText("This is the text in the default header");