Calling Microsoft Word from Java using EZ JCom
The EZ JCom Java API for Microsoft Word is
a complete MS Word API, as it has been
automatically generated from the MS Word
Type Library.
Java programs can use this API to run MS Word, either
visibly or invisibly in the background, for automatic
document generation/modification tasks.
Sample Programs
Following are some brief MS Word sample programs (also included in
the pre-packaged version.)
-
Hello Word. This sample starts
up a copy of MS Word, makes it visible, inserts the text "Hello Word", and
leaves Word running for the user.
-
Writing Text and Saving to a File. This sample starts
up a copy of MS Word, makes it visible, inserts some sample text (including a sample of
working with the Font) and saves it as the file C:\EZJWordSample1.doc.
-
Opening, modifying and saving a File. This sample starts
up a copy of MS Word, makes it visible, reads the file C:\EZJWordSample1.doc, modifies it
and saves it.
-
Iterate over the contents. This sample starts
up a copy of MS Word, does not makes it visible, opens the file C:\EZJWordSample1.doc,
retrieves and prints out the text from the file.
Leaves Excel running for the user.
Download
The MS Word API has been pre-built and packaged with the sample
programs. Those interested in calling MS Word
from Java should download this pre-packaged version
instead of using the EZ JCom tool directly to build an API.
|