my dog learned polymorphism*
The moose likes JSP and the fly likes How to open MS Word file in Internet Explorer using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to open MS Word file in Internet Explorer using java" Watch "How to open MS Word file in Internet Explorer using java" New topic
Author

How to open MS Word file in Internet Explorer using java

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Hi

I am allowing user to upload Microsoft Word document to my server.
I am able to upload the document on my server .
I am using Jakarta POI interface but it allows me to read simple format MS Word file

My problem is that :

How to show MS WORD file and HTML , means to open MS Word file as HTNL file through JAVA.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
There is no easy way to create HTML from a DOC file. Both Word and OpenOffice can save as HTML, so with some automation this may be possible. OO even has a Java API, but that has a definite learning curve.

Overall, I'd advise against trying to do this.


Ping & DNS - my free Android networking tools app
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Thanks a lot sir for your reply.

But i have to show the selected word file as output to the user.

Is there any other way to do this.

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
But i have to show the selected word file as output to the user.


Well, what I was getting at was that this is a lot of trouble for an uncertain outcome. Why not provide a link to the document instead, so that they can open it in Word, which knows how to display DOC files perfectly?
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Thanks a lot for your reply sir.

Actually , in the file selected by user i have to perform some actions and then to show data to user.

Thats why i need the whole structure in the DOC file , thats why its necessary to read it and show it in JSP.

Thanks
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Thanks for all the replies.

Can you please close this Thread here as i want to take this thread to Java(Advanced)

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
Thats why i need the whole structure in the DOC file , thats why its necessary to read it and show it in JSP.


I don't understand why providing a link to the document would not satisfy this goal.

Have you considered (or tried) using Word or OpenOffice as helper applications for converting the document to HTML, as I suggested above?
 
Consider Paul's rocket mass heater.
 
subject: How to open MS Word file in Internet Explorer using java