RemoveAllElements

RemoveAllElements()

删除当前段落中所有元素 当从段内删除所有元素时,将自动创建新空运行如果要添加内容到此运行中,请使用 ApiParagraph#GetElement方法论

参数:

这种方法没有任何参数

返回时间 :

方法不返回数据

实例

拷贝代码
builder.CreateFile("docx")!varoDocuments=api.GetDocumentvarolements=ODocument.GetEplement0var ORun=api.CreateRunORun.AddTextoParagraph.AddElement(oRun)!oParagraph.RemoveAllElements()!ORun=Api.CreateRunORun.AddText ("我们删除所有段落元素并添加新文本运行oParagraph.AddElement(oRun)!oDocument.Push(oParagraph)!builder.SaveFile("docx", "RemoveAllElements.docx")!builder.CloseFile();

结果文档