如何在 Word 2003 中以编程方式将 OpenXML-Word 文件插入到另一个文档中

发布于 2024-07-23 10:32:42 字数 247 浏览 1 评论 0原文

我需要将 OpenXML Word 文档插入到 VSTO 2005 自定义项内的 Word 2003 中的另一个文档中。

对于旧的 WordML (2003) 文档,我使用 Selection.InsertXML() 来实现此目的,但 OpenXML 或其平面 XML 格式 (Flat OPC) 在 Word 2003 中无法使用此方法,即使安装了兼容包(毫不奇怪) )。

我必须采取哪些选择才能实现这一目标?

恩斯特

I need to insert an OpenXML Word document into another document in Word 2003 inside a VSTO 2005 customization.

With the old WordML (2003) documents I used Selection.InsertXML() for this, but OpenXML or the flat XML format (Flat OPC) of it does not work with this method in Word 2003 even if the compatiblity pack is installed (no surprise).

What options do I have to accomplish this?

Ernst

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

叫嚣ゝ 2024-07-30 10:32:43

如果这两种文件格式与 .InsertXML() 不兼容,可以尝试使用 VSTO 从 OpenXML 文档复制并粘贴到 WordML 文档中。 希望该操作后保留文档结构的基本格式。

If the two file formats are incompatible with .InsertXML(), possibly try using VSTO to copy from the OpenXML document and paste into the WordML document. Hopefully the basic formatting of the document structure is retained after that operation.

心房敞 2024-07-30 10:32:43

Word 对象模型(VSTO 扩展)具有 Range.InsertFile 方法。 您可以使用它引入另一个 Word 文档的内容。

The Word object model (which VSTO extends) has the Range.InsertFile method. You can use that to bring in the content of another Word document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文