This project has moved and is read-only. For the latest updates, please go here.

Header & Footnote suport - Image placement

Jul 14, 2009 at 12:08 AM

Hi Cathal

Im using your library for editing .docx files (using a custom template, and replacing some text).

As far I know, seem to work very well!

However, there are some aspects about I would to ask you:

There are any suport for edit/replace the document's haeaders and footnotes?

Also, Im trying to insert an Image at some exact location (mm measured from page borders). How I can do that?

Thanks in advance!


(sorry for my bad English)


Jul 14, 2009 at 9:16 AM
Hi Gaspar,

I have not yet added support for headers and footnotes. A few people
have asked me for these features, so I will add them soon.

Also, at the moment I have not added any support for inserting images
at exact locations. I think that the only way to do this would be to
create a new paragraph and set its left margins to be (x mm) and then
place an image at the start of the paragraph. Word documents flow,
they do not work by exact positioning.

I hope this helps you,
kind regards,
Cathal Coffey
Jul 15, 2009 at 9:28 PM

Thanks for your fast answer Cathal!

I have been "playing" around with the footnote deal.

One solution I have found to edit Headers & footnotes is using "Custom properties" inserted on footnotes and headers of a template documents and then, edit them via DocX Library. Seems to work fine.

About the "image location" problem, I Google "using relative path on Word" (because I want to link a image into the .docx file, at precise location, but the file must be readed always from the .docx containig folder). I found this link: forum

I'm now trying to use "Custom properties" with DocX Library to change the image filename.

Hope your DocX keep updating!

Kind regards



Jul 15, 2009 at 9:54 PM
Hi Gaspar,

Once again, thank you for your interest. I have decided to add support
for headers and footers into the next version of DocX. I am very busy
at work at the moment, but I will try and find time soon.

To answer your last question. I will keep updating DocX for as long as
people show an interest in it.

kind regards,
Jul 17, 2009 at 5:42 PM


On Word 2007, if you use CustomProperty on Fields located in Headers or Footers, they not get updated until you do a "PrintPreview" (or select any of them and right-click, "Update Fields").

(after all, Word 2007 is by far more best piece of software than previous...)

Happy Coding



Jul 20, 2009 at 12:51 PM
Hi Gaspar,
This is an error in my reload logic. When a Custom Property gets updated, I run through the document line by line searching for that custom property and I force each instance of it to update. During this search I must be ommiting both the header and footer. I will update this logic for the next version of DocX.
This was a good bug find, thank you for your help. I will add a section to the documentation and give you credit for finding this :-)
kind regards and happy coding,