跳到主要内容

SetType

Specifies a type of the current section. The section type defines how the contents of the current section are placed relative to the previous section.

Syntax

expression.SetType(sType);

expression - A variable that represents a ApiSection class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTypeRequiredSectionBreakTypeThe section break type.

Returns

This method doesn't return any data.

Example

This example sets section break type "continuous".

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let section = doc.CreateSection(paragraph);
paragraph.AddText("This is section #1 of the document. ");
section = doc.GetFinalSection();
section.SetType("continuous");
paragraph = Api.CreateParagraph();
paragraph.AddText("This is section #2 and we set 'Continuous' type to it. ");
paragraph.AddText("As you can see, the section is not on a new page. ");
paragraph.AddText("If this section had some other type (nextPage, oddPage, evenPage), it would start a new page.");
doc.Push(paragraph);