跳到主要内容

GetNext

Returns the next section if exists.

Syntax

expression.GetNext();

expression - A variable that represents a ApiSection class.

Parameters

This method doesn't have any parameters.

Returns

ApiSection | null

Example

This example shows how to get the next section.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a new paragraph.");
paragraph.AddLineBreak();
paragraph.AddText("Scroll down to see the new section.");
let section1 = doc.CreateSection(paragraph);
paragraph = Api.CreateParagraph();
paragraph.AddText("This is a paragraph in the first section");
doc.Push(paragraph);
let section2 = doc.CreateSection(paragraph);
let nextSection = section1.GetNext();
nextSection.SetPageMargins(7200, 2880, 1440, 5760);