5
votes

I'm trying to add a new header (manually by using openxml code) to docx (office 2010) document which already contains a header (header1.xml). I tried to do it with openxml by adding a file named myheader.xml with only one paragraph. When opening the document at word, the content of header1 is presented in different position (2 lines lower) than it was before.

When I deleted the paragraph, (only <w:hdr> </w:hdr> with the relevant name spaces) the content of header1 was still presented in a different potion ( only 1 line lower)

Is there a solution for this issue?

1
So you're trying to read in an existing XML file from disk that contains the right OpenXML markup and add that to a new section in your Word 2010 document, is that right? - Phil.Wheeler

1 Answers

0
votes

I suggest you check out this thread here: Add Header and Footer to an existing empty word document with OpenXML SDK 2.0

I think it will this solve this problem as, its a little more involed that just adding a paragraph, but not much.