Skip to main content

GetCurrentParagraph

Returns the current paragraph where the cursor is located.

Inherited from ApiDocumentContent.GetCurrentParagraph.

Syntax​

expression.GetCurrentParagraph();

expression - A variable that represents an ApiDocument class.

Parameters​

This method doesn't have any parameters.

Returns​

ApiParagraph

Example​

Access the paragraph where the cursor is placed in a document.

// How do I get the paragraph at the current cursor position in a document?

// Apply bold formatting to the paragraph the user is actively editing in a document.

const doc = Api.GetDocument();
const paragraph = doc.GetCurrentParagraph();
paragraph.AddText('This is current paragraph');
paragraph.SetBold(true);