File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open MS Word from Java

 
Venkatesh buddala
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Friends
Please slove my problem ..

I want to open Ms-word & load a .doc file when a button clicks from AWT GUI Application.

Actually i want to save my database out put into an ms-word document & open it from Java AWT Application(when a button clicks).

for Generating MSWORD
We generated the db output & add html tags and written into File & save this files with .doc extension. this is solve the problem of generating MSword file & MS-WORD interpreting these files proparly.

But now i want to Open MS-WORD & load the generated file.could you some one please give the solution & also is there any better way to generate ms-word files from java.

Thanks in Advance
 
nomeaning
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must read POI

http://jakarta.apache.org/poi/index.html

Hope this information is useful
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you're already creating files that Word can open. In that case you don't need POI. What happens if you stream the word file to the browser - does it not cause Word to be opened, or at least the user to be asked what he wants to do with the file?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the command line, you'd use

start filename.doc

to open word with the file. Executing that line with Runtime.exec should give you the desired result. Of course that only works on Windows...

Not a GUI question, moving to Java in General...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic