Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 OpenXML Word 文档插入到 VSTO 2005 自定义中 Word 2003 中的另一个文档中。
对于旧的 WordML (2003) 文档,我为此使用了 Selection.InsertXML(),但即使安装了兼容包,OpenXML 或它的平面 XML 格式 (Flat OPC) 也不适用于 Word 2003 中的此方法(不足为奇) )。
我有什么选择来完成这个?
恩斯特
如果这两种文件格式与 .InsertXML() 不兼容,可以尝试使用 VSTO 从 OpenXML 文档中复制并粘贴到 WordML 文档中。希望在该操作之后保留文档结构的基本格式。
Word 对象模型(VSTO 扩展)具有 Range.InsertFile 方法。您可以使用它来引入另一个 Word 文档的内容。