跳到主要内容

Insert text

Inserts text into the document at the current cursor position.

(function()
{
let doc = Api.GetDocument();
let paragraph = Api.CreateParagraph();
paragraph.AddText("Hello world!");
doc.InsertContent([paragraph]);
})();

Methods used: GetDocument, CreateParagraph, AddText, InsertContent

Result

Insert textInsert text