Skip to main content

InsertParagraphBreak

Add paragraph to the document on the cursor position.

Syntax​

expression.InsertParagraphBreak();

expression - A variable that represents an ApiPresentation class.

Parameters​

This method doesn't have any parameters.

Returns​

boolean

Example​

Insert a paragraph break at the current cursor position within a shape.

// Splits the text at the cursor into two separate paragraphs.

// Create a shape, position the cursor after the first word, and insert a paragraph break.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const shape = Api.CreateShape("rect", 3000000, 1500000);
const range = shape.GetTextRange();
range.SetText("Hello World");
range.SetColor(Api.RGB(0, 0, 0));
range.MoveCursorToPos(5);
presentation.InsertParagraphBreak();
slide.RemoveAllObjects();
slide.AddObject(shape);