I have used both docx4j and Apache's POI libraries, if you are working with .docx I would recommend .docx4j. Automated alot of the process of creating a .docx.
There is a great exmaple here : http://java.dzone.com/articles/create-complex-word-docx
on how to create a .docx using the docx4j package.