Question

What is the recommended strategy for in code to splice a set of MS Word documents together into one?

Cheers

Nik

OTHER TIPS

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top