We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Header Issue


When i try to merge multiple documents with different headers, we have noticed the header from the first document is carried over to the next document if the second document does not have header. If that is known issue or there is a workaround kindly let me know. Please find the sample documents attached.



Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think that you should just unlink headers/footers. See the following code:

Document doc1 = new Document(@"Test238\doc1.doc");

Document doc2 = new Document(@"Test238\doc2.doc");

//Loop through all sections in src document

foreach (Section sect in doc2.Sections)


//Unlink headers/Footers


//Import node

Node dstSect = doc1.ImportNode(sect, true, ImportFormatMode.KeepSourceFormatting);



//Save document


Hope this helps.

Best regards.