I am working on a web application that produces WordML files. This is fine for users who have Word 2003 installed which supports WordML.
Unfortunately some users only have Word XP (2002) and cannot open and read the WordML documents. For those users I would like to provide the documents in the binary .doc format.
There seems to be no converter. Therefore I want to do the following.
Either in a servlet or a JSP page
1.) I want to take the WordML document that was created
2.) Open an instance of Word 2003 on ther server
3.) Load the document in this Word 2003 Instance
4.) Save the document as .doc
5.) Put the .doc in the response object and send it to my users
How could I do that?
Who can point me in the right direction or provide some sample code?
WordMLDocument doc = getDocument(request); //Gets a handle on the WordML document
doc.cleanup(); //processes the WordML document
// At this point I would need to create a .doc binary document
response.setContentType("application/msword"); //sets the MIME Type
response.getOutputStream().write(doc.getHtmlBytes()); //sends the WordML doc to the user