跳到主要内容

MoveCursorOutside

Places a cursor before/after the current content control.

Syntax

expression.MoveCursorOutside(isAfter);

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isAfterOptionalbooleantrueSpecifies whether a cursor will be placed before (false) or after (true) the current content control.

Returns

This method doesn't return any data.

Example

This example shows how to move the cursor outside the content control.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("The cursor will be placed after the current content control.");
doc.AddElement(0, blockLvlSdt);
blockLvlSdt.MoveCursorOutside(true);