跳到主要内容

CreateNewHistoryPoint

Creates a new history point.

Syntax

expression.CreateNewHistoryPoint();

expression - A variable that represents a ApiDocument class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

This example creates a new history point.

// How to add a history point after adding the text.

// Add a text to the paragraph, create a history point and change its text.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a sample text.");
doc.CreateNewHistoryPoint();
paragraph = Api.CreateParagraph();
paragraph.AddText("New history point was just created.");
doc.Push(paragraph);