This project has moved. For the latest updates, please go here.

Copy Header from File1.Docx into File2.Docx

Feb 27, 2012 at 10:10 PM

As the title says how can i copy a header/footer from one file into another?

If the File1 Header is just basic text if i simply set the Header property from one into the other it works without issues, but the problem is when there is a image in the File1.. after some reading it seems that its quite complicated to do so (check the ids and such)..

is there any easy way without using interop to do so? or is there some trick in this library that would allow me to do?

Thanks in advance and also good job to the creator, its a great library.. i made a few modifications myself (allow password protection / change the page margins / and such, if anyone needs.)

Developer
Feb 27, 2012 at 10:39 PM

Hello equilherme. Please submit the code modifications you did to Cathal or maybe attach it here. If it will be good code I'm sure Cathal will let you add your modifications directly to Source Code and become one of developers. This would benefit everyone.

Feb 28, 2012 at 12:49 PM

some modifications are quite extensive, but i can reply here later,

anyway regarding my initial question, i have resolved the problem for now, and created a new method in the header/footer to make the copy (but since it was somehow an urgent problem, the code is.. hmm.. not nice lol)

Developer
Feb 28, 2012 at 12:55 PM

It seems to me with your knowledge (if what you have made so far is good) you would be very nice addition to development squad (of course if you're willing to add new things :P)). This library needs someone more active.