The getNextSection method returns the next section of a document (if the document has been divided into sections).

The document object passed to the script's handler function represents the first section of the document. This means that the methods described in this section read and modify only the first section.

Calling getNextSection on the LuaDocument passed to the handler function will always return the second section. To perform operations on every section, see the example below.

When a document is divided into sections, each section has the same fields. The only difference between each section is the document content (the value of the DRECONTENT field).




(LuaDocument) A LuaDocument object that contains the next DRE section.


To perform operations on every section, use the following script.

local section = document
while section do
	-- Manipulate section
	section = section:getNextSection()