加入 MS Word 文档
在代码中将一组 MS Word 文档拼接成一个的建议策略是什么?
干杯
尼克
What is the recommended strategy for in code to splice a set of MS Word documents together into one?
Cheers
Nik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://www.codeproject.com/KB/aspnet/AppendWordDocuments.aspx
或其中任何一个:
http://www.google.com/search? hl=en&q=append+microsoft+word+documents
http://www.codeproject.com/KB/aspnet/AppendWordDocuments.aspx
Or any of these:
http://www.google.com/search?hl=en&q=append+microsoft+word+documents
去看看各种可用的 SDK。 如果您使用的是 Word 2007,这会更容易,因为该文件实际上是包含各种 XML 文档的 zip 文件。 MS 甚至有一个名为“Open XML Format SDK 1.0”,它提供了用于处理新办公格式的强类型类。
Go look at the various SDKs available. This is much easier to do if you are using Word 2007, as the file is actually a zip file containing various XML documents. MS even has an SDK called "Open XML Format SDK 1.0" which provides strongly typed classes for working with the new office format.
如果您使用 Open XML(即 docx),有 2 个基本的
解决这个问题的方法:
首先是做必要的事情,让 ids 指向正确的
关系(例如图像、超链接)和样式定义等。
您可以在以下位置找到有关您需要做什么的详细解释
http://blogs.msdn.com/ericwhite/archive/2009/02/05/move-insert-delete-paragraphs-in-word-processing-documents-using-the- open-xml-sdk.aspx
PowerTools 实现了这一点。
第二种是使用altChunk:
http: //blogs.msdn.com/ericwhite/archive/2008/10/27/how-to-use-altchunk-for-document- assembly.aspx
If you are using Open XML (ie docx), there are 2 basic
approaches to solving this problem:
The first is to do what is necessary so ids point to the correct
relationship (eg for images, hyperlinks), and styles are defined etc. A
good explanation of what you need to do can be found at
http://blogs.msdn.com/ericwhite/archive/2009/02/05/move-insert-delete-paragraphs-in-word-processing-documents-using-the-open-xml-sdk.aspx
PowerTools implements that.
The second is to use altChunk:
http://blogs.msdn.com/ericwhite/archive/2008/10/27/how-to-use-altchunk-for-document-assembly.aspx