Copy content from docx to one empty docx but contains header and footer

Is there a way to copy the content from the one docx to another docx.

ex: source.docx (only copy content)
dest.docx( empty but have only header and footer)

is there a way to copy content from source.docx to dest.docx but should have all type of header on the dest.docx (all type meaning → 1. odd-even 2. first page -rest 3. all has same header footer)

I have tried using this code.

// Load source and destination Word documents
var doc = new Document("source.docx");
var docDest = new Document("dest.docx");

// Copy the content from source document to destination document
docDest.AppendDocument(doc, ImportFormatMode.KeepSourceFormatting);

// Save document
docDest.Save("Mergeoutput.docx");

I am able to get the first page header and footer as is but not able to get the other page or odd even header footer.

2nd page header footer was missing even though souce.docx file has that header and footer.

Can someone please help me with this?

@m.darshan.shah In your case you can use DocumentBuilder.InsertDocument method instead of Document.AppendDocument. Please try using the following code:

Document doc = new Document("source.docx");
Document docDest = new Document("dest.docx");
DocumentBuilder builder = new DocumentBuilder(docDest);
builder.InsertDocument(doc, ImportFormatMode.KeepSourceFormatting);
docDest.Save("Mergeoutput.docx");