Get Started
Usage API
More information

GetNext

GetNext() → { ApiSection | null }

Get the next section if exists.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiSection | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a new paragraph.");
oParagraph.AddLineBreak();
oParagraph.AddText("Scroll down to see the new section.");
oSection1 = oDocument.CreateSection(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a paragraph in the first section");
oDocument.Push(oParagraph);
oSection2 = oDocument.CreateSection(oParagraph);
oNextSection = oSection1.GetNext();
oNextSection.SetPageMargins(7200, 2880, 1440, 5760);
builder.SaveFile("docx", "GetNext.docx");
builder.CloseFile();

Resulting document