清除 Content

清除 Content ()

清除当前运行内容

参数:

这种方法没有任何参数

返回时间 :

方法不返回数据

实例

拷贝代码
builder.CreateFile("docx")!varoDocuments=api.GetDocumentvarolements=ODocument.GetEplement0var ORun=api.CreateRunORun.AddText ("这只是样本文本)ORun.AddText ("但你不会在生成文档中看到它,因为它将被清除.")oParagraph.AddElement(oRun)!oRun.ClearContent()!odeptes = Api.CreatelementsORun=Api.CreateRunORun.AddText ("前段文本无法显示,因为它已被清除")oParagraph.AddElement(oRun)!oDocument.Push(oParagraph)!builder.SaveFile("docx", "ClearContent.docx")!builder.CloseFile();

结果文档