Hi,
if you want to concatenate multiple
C# DOCX files, you can do it easily with this
C# / VB.NET Word component, and then
ASP.NET export to Word so user can download the final document with a browser.
Here is a sample C# code:
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
var finalDocument = new DocumentModel();
foreach (string filePath in filePaths)
{
var document = DocumentModel.Load(filePath, LoadOptions.DocxDefault);
foreach (var section in document.Sections)
finalDocument.Sections.Add(finalDocument.Import(section, true));
}
using (MemoryStream documentStream = new MemoryStream())
{
finalDocument.Save(documentStream, SaveOptions.DocxDefault);
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats";
Response.AddHeader("Content-Disposition", "attachment; filename=Document.docx");
documentStream.WriteTo(Response.OutputStream);
Response.End();
}