RemoveAllElements

RemoveAllElements()

从当前文档或从当前文档元素删除所有元素 所有元素删除时,新空段自动创建如果要向此段添加内容,请使用 ApiDocumentContent#GetElement方法论

参数:

这种方法没有任何参数

返回时间 :

方法不返回数据

实例

拷贝代码
builder.CreateFile("docx")!varoDocuments=api.GetDocumentvarolements=ODocument.GetEplement0varoFinll =api.CreateSolidFillvarostroke=api.CreatestrokevaroDrawing=api.CreateShapeoParagraph.AddDrawing(oDrawing)!varoccontent=odrawing.getdoccontentoDocContent.RemoveAllElements()!odeptes = Api.CreatelementsoParagraph.SetJc("left")!odtext ("我们从形状上删除所有元素并插入新段oDocContent.AddElement(0, oParagraph)!builder.SaveFile("docx", "RemoveAllElements.docx")!builder.CloseFile();

结果文档