About Me

My photo
Hello, my name is Cathal Coffey. I am best described as a hybrid between a developer and an adventurer. When I am not behind a keyboard coding, I am hiking and climbing the beautiful mountains of my home country Ireland. I am a full time student studying Computer Science & Software Engineering at the National University of Ireland Maynooth. I am finishing the final year of a 4 year degree in September 2009. I am the creator of an open source project on codeplex.com called DocX. At the moment I spend a lot of my free time advancing DocX and I enjoy this very much. My aim is to build a community around DocX and add features based on requests from this community. I really enjoy hearing about how people are using DocX in their work\personal projects. So if you are one of these people, please send me an email. Cathal coffey.cathal@gmail.com

Friday, August 14, 2009

DocX v1.0.0.7 released

I have just uploaded DocX version to docx.codeplex.com. This version comes with an extra optional download “Advance – Invoice Example.zip”.

“Advance – Invoice Example.zip” is a zipped Visual Studio 2008 solution that I created to demonstrate how far DocX has evolved since version The first time that you run InvoiceExample.exe it will check for the existence of a document called “InvoiceTemplate.docx”, because this is the first execution this document will not exist, so it is created.

Figure 1.0 - InvoiceTemplate.docx created by first run of InvoiceExample.exe

It is important to note that everything you see in the above screenshot was created by DocX. If you now run InvoiceExample.exe again the document “InvoiceTemplate.docx” is found and it is now used to create an invoice for a factitious company called “The Happy Builder”.

Figure 1.1 - Invoice_The_Happy_Builder.docx created by second run of InvoiceExample.exe

As you can see DocX has loaded the document “InvoiceTemplate.docx” into memory and customized it. This was done by setting custom property values, inserting an image, creating a picture from this image, and replacing a Table with a new Table that contains data from a data source.

This example is intended for an experienced user of DocX. A first time user may find this solution overwhelming. Over the next few days, I am going to create a video tutorial called "Getting started with DocX". This video will be targeted at the first time user of DocX.

I hope that from this example you can see how quickly Docx is growing and also how useful it is becoming. As always if you would like to report a bug, request a feature or even just say hi, please email me at coffey.cathal@gmail.com.

happy coding,

DocX is completely free, but if you have found it useful and you would like to make a donation you can do so via paypal.


  1. Paypal link report:
    "Sorry, an error occurred after you clicked the last link"

  2. Really awesome piece of work, I will definitely it it a try. Documents looks really nice generated through this tool.

  3. Great project Cathal, makes generating data driven word docs a breeze.

  4. Sounds so interesting and will surely try.. i am sure i would be big fan after looking at it. developerjigar@gmail.com

  5. Hi! I've been trying to develop an example test application to test the merging of fields in my own docx template. I'm confused as to what type of field to add for these merging fields in Word 2010?

    I looked through your source code that updates these fields and it appears that the method UpdateCustomPropertyValue looks for DOCPROPERTY elements. Why is this? I would've thought that mail merge would've been more appropriate?

  6. hii Cathal

    I've been trying combine docx file but can't open because "cannot be opened because there are problems"

    thank you


  7. Great tool, But here i facing few problems.
    I load .dotx template and save as .docx file.

    my dotx template contains textbox that not read by DocX.Load() method
    it gives error "sequence does not contains element".


  8. I have a question here.. Once you create table , do we have a option to repeat the table header in each page of the word doc once page is more than 1.

  9. where is the video @Cathal?

    i'm interested with your project....

  10. This comment has been removed by the author.

  11. Hi, I have some html content which i want to add to my word doc. But its showing html tags as it is. For e.g. "Hi" as printed as it is. What i want is it to be bold. Any leads are appreciated. Thanks!!

  12. This comment has been removed by the author.

  13. Do you have a line count object? For instance, If i want to count the number of lines on a page so that i can insert a picture in the middle of the page, how do i do that? Thanks.

  14. This comment has been removed by the author.

  15. I'd like to let the headings get numbered automatically. (Just like at Word 2010 when you press the button "List with many level" and select the option where the headings get numbered just as I want them to (the standard word functionality)). Is there a way to accomplish this using DocX

  16. This comment has been removed by the author.

  17. Thanks for the docx library and helping .net coding tips!