I need to insert an OpenXML Word document into another document in Word 2003 inside a VSTO 2005 customization.
我需要在VSTO 2005自定义内的Word 2003中将OpenXML Word文档插入另一个文档。
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).
使用旧的WordML(2003)文档,我使用了Selection.InsertXML(),但是即使安装了兼容包,OpenXML或它的扁平XML格式(Flat OPC)也无法在Word 2003中使用此方法(毫不奇怪) )。
What options do I have to accomplish this?
我有什么选择来实现这一目标?
Ernst
2 个解决方案
#1
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.
如果这两种文件格式与.InsertXML()不兼容,可能尝试使用VSTO从OpenXML文档进行复制并粘贴到WordML文档中。希望在该操作之后保留文档结构的基本格式。
#2
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.
Word对象模型(VSTO扩展)具有Range.InsertFile方法。您可以使用它来引入另一个Word文档的内容。
#1
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.
如果这两种文件格式与.InsertXML()不兼容,可能尝试使用VSTO从OpenXML文档进行复制并粘贴到WordML文档中。希望在该操作之后保留文档结构的基本格式。
#2
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.
Word对象模型(VSTO扩展)具有Range.InsertFile方法。您可以使用它来引入另一个Word文档的内容。