是否存在 OpenXML SDK v2 中未公开的功能?
我想知道是否有什么事情是你不能使用COM接口中公开的SDK做的?
I want to know if there is anything that you cannot do with SDK that was exposed in the COM interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenXML SDK 是 OpenXML 文件格式的便利层。使用此 SDK,您可以对文件格式执行所有可能的操作,例如插入、修改和删除内容、元数据和格式。
与 Office 的 COM 自动化相反,您无法执行与应用程序逻辑相关的任何操作。举一些例子:使用 OpenXML SDK,您无法知道文本文档中某个元素的页码,因为这需要分页,您无法重新计算电子表格的公式,因为这需要 Excel 的数学引擎,或者您无法将演示文稿幻灯片转换为图像,因为这需要 PowerPoint 来呈现幻灯片。
关于 Word,您可以查看以下演示,其中演示了何时使用 OpenXML SDK 与 Office 自动化:
The OpenXML SDK is a convenience layer for the OpenXML file format. Using this SDK you can do everything that is possible to do with the file format, e.g. insert, modify and remove content, metadata and formatting.
In contrast to COM automation of Office you can't do anything that is related to application logic. To give you some examples: Using the OpenXML SDK, you can't know the page number of a certain element in a text document because that would require pagination, you can't recalculate the formulas of a spreadsheet because that requires Excel's math engine, or you can't convert a presentation slide into an image because that requires PowerPoint to render the slide.
Regarding Word, you can have a look at the following presentation which demonstrates when to use the OpenXML SDK vs. Office automation: