跳到主要内容

AddText

向当前段落添加文本。

语法

expression.AddText(text);

expression - 表示 ApiParagraph 类的变量。

参数

名称必需/可选数据类型默认值描述
text必需string要插入到当前文档元素中的文本。

返回值

ApiRun

示例

此示例向段落添加一些文本。

// How to insert the text to the paragraph.

// Add paragraph text.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text. Nothing special.");