CreateRun
创建要插入到当前段落或表格中的新的较小文本块。
语法
expression.CreateRun();
expression - 表示 Api 类的变量。
参数
此方法没有任何参数。
返回值
示例
向文档中的第一个段落添加格式化文本段。
// How do I create a standalone piece of text and append it to an existing paragraph in a document?
// Insert new text into a paragraph as a separate block that can carry its own formatting in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let run = Api.CreateRun();
run.AddText("This is a text run");
paragraph.AddElement(run);