user3607722
user3607722

Reputation: 3

Merging word documents and preserve their formatting, header and footer

I have a trouble on merging multiple word documents into single. I had a scenario where I am generating word documents from html with header and footer. I have around 10-15 such documents. I am generating these word document individually and are working fine.

Now, I have a requirement to generate html of all 10 pages and combine them to single word report. These should preserve the individuals report's formatting, header and footer. I have tried this in two ways but didn't get success:

  1. Combined html of all pages into one html page and then finally saved file as word file.
  2. Created word report for all 10 html files individually and merged them using Microsoft.Office.Interop.

I was able to merge the document but was not able to keep the header, footer and formatting of the individual document. I have searched about section-break too but not sure how to use this.

Please see if anyone can guide me toward the possible solution or anything else that can help me.

Thanks in advance.

.

Upvotes: 0

Views: 1178

Answers (1)

JasonPlutext
JasonPlutext

Reputation: 15878

You could try merging with DocumentBuilder

If that doesn't give you enough control, see whether docx4j.NET (commercial edition) might help, with its demo merge webapp. Docx4j's MergeDocx provides fine grained control over header/footer behaviour.

Upvotes: 0

Related Questions