5

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
BenDevNull
  • 51
  • 1
  • 1
  • 2
  • 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 Mar 22 '12 at 01:20

1 Answers1

0

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.

Community
  • 1
  • 1
James Wood
  • 17,286
  • 4
  • 46
  • 89