Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Merging word documents server -side  RSS feed

 
Fredrik Danielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how I can merge some content from a file into a MS Word document containing merge fields, using server-side Java-code?
 
Sarath PS
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
http://jakarta.apache.org/poi/
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15861
81
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, Apache Jakarta POI still doesn't have a lot of support for Word.

Krishnan Viswanath recently had an article about using the OpenOffice Java API for doing things like mail merge with Word documents from Java. See his article: OpenOffice Java API
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper's right. POI's word support is dead in the water.
I use OpenOffice for a number of conversion and merge tasks. Krishnan's article seems to be lacking the essential links to the OpenOffice API Documentation and OpenOffice Forums, both of which contain valuable information and examples.
 
Fredrik Danielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to open a Word document using POI. But it doesn't seem to be built in function for replacing merge fields. Anyone know how to do this?
Thanx.
 
Fredrik Danielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Ess:
Jesper's right. POI's word support is dead in the water.
I use OpenOffice for a number of conversion and merge tasks. Krishnan's article seems to be lacking the essential links to the OpenOffice API Documentation and OpenOffice Forums, both of which contain valuable information and examples.


As far as I can see the OpenOffice API needs an installation of OpenOffice on the server (?). This is unfortunately not an option for me. I need a standalone API which can read and and merge Word documents.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Fredrik Danielsen:
As far as I can see the OpenOffice API needs an installation of OpenOffice on the server (?).


OpenOffice needs a running instance, not necessarily a local install. The API is a network-object protocol, so as long as the OpenOffice instance is reachable via TCP/IP, it should work.
 
Fredrik Danielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OpenOffice API is, for some reasons, not an option for me. What I would like to know is if anyone has used POI and HWPF to replace text in a MS Word document?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!