This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Manipulating Microsoft word using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Manipulating Microsoft word using java" Watch "Manipulating Microsoft word using java" New topic

Manipulating Microsoft word using java

dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Hi All,
I have a microsoft word template that contains images,header,footer and a table.
Now, I want to create a servlet or any other java/xml program which takes some values from database, open my existing word template and put database values in table of word template. Is it possible if yes then please suggest how. I tried using iText but it could not work properly as my word template is already existing. I just need to fill the values of database into word table.

Thanks in Advance.
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
well, this is not specific jsp / web stuff, so someone might want to move the thread to a more appropriate place...

anyhow, office document manipulation can be done quite comfortable with apache-poi (here). i did some stuff with excel-templates, and from javadoc i know that word is also supported.

hope it helps,
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I agree, I'm moving this to the Other APIs forum.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
POI is an option, although its Word capabilities are not maintained anymore. OpenOffice also handles doc files, and it has a powerful API that you can use. It has a steep learning curve, though.

What were you trying to do with iText? It does not deal with Word documents at all, although it does handle RTF.
dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Thanks Ditter,
I know iText deals with .rtf files. But as I was not getting any option, I thought of trying .rtf files. But it did not work as my document is complex one.
Anyhow, Thanks for your suggestions. I wil try to resolve my problem as suggested by you. In case i get any problem i will get back to you. Thanks once again.
rocket mass heater kickstarter
subject: Manipulating Microsoft word using java