Open/save word document in jsp

I can open a word document in jsp but i don't know how to save and close it to where i want again inside same jsp.
I find a code that do thing i want to do but it was written in vb script.
How can i convert vb code below to java / jsp?
Dim wrdApp As Word.Application
MyStr = Format(dtMyDate, "mmm dd, yyyy") & ".doc"
Set wrdApp = New Word.Application 'released first resources
With wrdApp
.Documents.Add "normal.dot", , , True
strPatientName = txtName.Text
strFileName = "c:\MJCC\Lab\" & strPatientName & "_" & MyStr
.ActiveDocument.SaveAs strFileName
.ActiveDocument.Close
.Quit
End With
Set wrdDoc =Nothing

<%@ page contentType="application/vnd.ms-excel" language="java"%>
<meta http-equiv="Content-Type" content="application/vnd.ms-excel; charset=iso-8859-1">
by using this 2 codes, when i run this page, it will pop up a box for me to save the jsp file..
i'm able to save it in xls / csv format...
so, mayb you can try change the ms-excel to ms-word or something else..
hope this is useful...

Similar Messages

  • Opening an word document in a servlet

    Hi,
    How can i open a word document in servlets. Is any jar file required for opening this. Can anyone help out me ?
    bye

    I will have the same problem in my project: i think that i will load the word document in a jsp.
    Because with word when you can use "save as" and you can save your document as web format.
    The document will be rephrase with html marker.
    You can try to save your document with this format and load it in your web browser to see if the display is good for you.

  • Opening a word document for editing with webdav

    I'm not sure if this is the correct place for this question..
    I am attempting to open a word document, which resides in a webdav folder from web app. I need IE to start word and open the original document from the webdav folder and allow the user to make changes to the document and save it back to the webserver.
    Wep app this http://www.javatalks.ru/go.php?uri=http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
    I've got it to open the document but it seemed to have copied the document to my temporary internet files folder and opened the copy from there. The original file name is "test.doc" but the opened temprary file is "test[1].doc" and so on. How can I get it to open the original document for editing?
    Any help would be appreciated..

    Not sure about payment options but you can check for yourself at http://success.adobe.com/en/na/sem/products/acrobat/feature.html

  • When opening a Word document... an option box displays which I placed a check to 'Do this automatically...' but when redoing same process... option box display.

    We're using EBS application that has a option to open/create download Word document. When we use Firefox v30 to open a Word document, a option box displays to inform where the document is to be open and/or save and a check box which is unmarked... which states... 'Do this automatically for files like this from now on'. I've checked the box and clicked 'OK'. I also checked Firefox options to the application and I checked and verified the Word document settings to 'default'. What happens after re-checking the process to open a Word document... the same open option box displays again... the check box is engage though. I would think that after selecting the box... this display box will not display but directly open the Word document. Please let me know if there is another setting or suggestion.
    Thanks,
    Wil

    The server must
    * Send the correct Content-Type header (e.g. ''application/msword'' MIME type).
    * Not send the ''Content-Disposition: attachment'' header.
    You can use the Web Console to examine the response headers for the file request in question and see if the above two conditions are met.
    * https://developer.mozilla.org/docs/Tools/Web_Console
    If they're not, the workarounds are the Force Content-Type and InlineDisposition add-ons, respectively. I don't know if Force Content-Type still works though.
    * https://addons.mozilla.org/firefox/addon/force-content-type/
    * https://addons.mozilla.org/firefox/addon/inlinedisposition/

  • I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    The template is a document in itself, it is not applied to an existing document whether it is a Pages document or a Word document converted to a Pages document.
    You would need to either copy and paste content, using existing styles, or apply the styles to the converted Word document.
    You can Import the Styles from an existing document and those imported Styles can be used to override the current document's styles:
    Menu > Format > Import Styles
    The process is simplified if the styles use the same names, otherwise you will need to delete the style you don't want and replace it with the one that you do want when asked, then the substitution is pretty straightforward.
    Peter

  • HT202879 how can I open a Word document in Pages 09?

    How can I open a Word document using Pages 09 please? I am trying to open Word documents from a CD using both trying to open in Pages, nd dragging and dropping into the Pages icon in the dock. It tells me, every time, thast the document cannot be opened.

    What happens if you open it in TextEdit or LibreOffice [free]?
    Does it open where you got it from?
    Peter

  • Open a word document from a Java Application

    Hi,
    Can I open a word document from a java GUI apllication and point to a bokkmark automatically in the word document when opened.

    See this thread:
    http://forum.java.sun.com/thread.jspa?threadID=228332&messageID=810684

  • How can I open a word document in C++ with a CNiWordApplication object?

    Hello,
    For an application, i need to open a word document using VisualC++ and CNiWord classes (CNiWordApplication, CNiWordDocument...). I successed to create a new CNiWordDocument with the CNiWordApplication CreateDocument() function. But when using the OpenDocument() I have error message about violation error. Must I create another objet before calling the OpenDocument() function? Is it possible to have an example of code to open a word document?
    Thank you for your help.

    I tried the following code to open a doc file in an MFC application.
    CNiWordApplication word;
    CNiWordDocument doc = word.OpenDocument("c:\\books.doc");
    This worked fine for me. I tried this with Word 2003 and Measurement Studio 7.1
    Try running one of the shipping examples. You can find examples for this under ..\MeasurementStudio\VCNET\Examples\Office\
    Hope this helps.
    Bilal Durrani
    NI

  • Did I miss something in the fine print? I installed Lion and and come to find out, I can no longer open any Word documents or Excel spreadsheets as they are no longer supported (being PowerPC apps).  Seriously?!?!?!?!!   What are my alternatives?

    Did I miss something in the fine print? I installed Lion and and come to find out, I can no longer open any Word documents or Excel spreadsheets as they are no longer supported (apparently because they are PowerPC apps).  Seriously?!?!?!?!!   What are my alternatives?

    Hi Mary and Matthew
    You might find it helpful to "try before you buy" - there is a 30 day free trial offer for Office for Mac 2011, accessible from M's .com website.
    You may be able to use this period to open and resave your old documents in a format that enables you to switch instead to using Apple's iWorks apps moving forward.
    I initially intended to do something similar, but ended up buying Office as it provided an easier way (for me, at least) to continue working with years worth of old emails, letters, spreadsheets and other documents (from my PC days) without risking damage to their integrity, formatting, etc.

  • Can't Save Word documents

    Suddenly I can't save Word documents or even exit Word without using force quit. How can I correct this

    Then you have an iMac Intel, not a PPC.    Now, since you haven't installed a security update, and you are sure you haven't the only reason the documents may not save is that the installation was not good.   Be sure first your data is backed up.  Try to run the installer for Office inside the Installer folder, and to be doubly certain, download the latest Office v.X patch.  If it still doesn't work, you may want to try an Office alternative such as NeoOffice, OpenOffice, Google Docs, or Zoho Writer.

  • When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    gonsa47 wrote:
    When I open it in pages or word the correct company logo appears.
    Does the mail app display whatever is in the document without the ability to differentiate between hidden or non hidden images?
    The mail app will not display fillable form fields in PDF files that can be seen in real PDF apps. I say real PDF apps because the form fields in PDF apps will not appear in the iBooks app either. IMO, iBooks is not a real PDF app.
    So, I would say that the mail app cannot differentiate between hidden and non hidden items

  • When I try to install abode - it will download but says i have to close firefox before it will install. also i try to open a word document from a website and it will not open - it will only download

    i install abode - it will download but not install and indicates i have to close firefox before it will download. Also, I try to open a word document from a website - it will download but not open.

    You need to close Firefox to install many plugins, including those from Adobe.
    As for the Word downloads, see the changing downloads action section of this link - https://support.mozilla.com/kb/Managing+file+types

  • How do i open a word document as a sub-VI?

    i need  to use/open a word document or a web page as a sub-VI. All im able to do now is upload it as a text format and it dosen't look to presentable.
    i have been trying the Active function and it dosent seem to work as i am not to familiar with it. i need suggestion to  overcome this problem
    thanks

    to: smercurio_fc
    i am not able to view the example you suggested. it sounds interesting pls suggest a different way.
    i want to upload a word document or a repective web page can u pls suggest a solutioj
    thanks
    pravin

  • How do I open a WORD document which is password protected?

    I need to open a word document, which is password protected.  I can't even get to a page that'll allow me to put in the password!!!  Can anyone advise how I can do this?
    Thanks.

    Hi JoeyR.
    Thanks for your reply.
    I get the following message when I try to open the document: "The Word document is password protected and can’t be imported".
    I've looked at the Open Office software, as you suggested, but it seems confusing.  I'll give it a try, though, as I'm wasting too much time!
    Fingers Crossed!

  • Opening a Word Document in Pages - floating objects not supported

    I am trying to open a Word document in pages. It is a table of labels with artwork and text. Pages tells me that floating objects inside cells are not supported and were deleted. I've tried making them inline with text in the original document and then opening in Pages, but then I can't make them floating again. Anyone know how to do this? I really don't want to have to buy a Microsoft product!

    Don't buy a M…soft product, use the free openOffice or the free neoOffice.
    Yvan KOENIG (VALLAURIS, France) samedi 18 décembre 2010 18:09:50

Maybe you are looking for

  • Netflix not working properly after ATV update

    After the update, movies at netflix after some seconds, video starts from the beginning and audio still plays normal. Can't see anything like that. Have to fast forward so video comes back to original point. Can you guys help me out?

  • Sending mail to yahoo using javamail

    hello, i have a javamail code which able to send mail within my domain (mailserver ) . but when i try to send mail to any yahoo id then i get following error :-- javax.mail.SendFailedException: Invalid Addresses; please, anyone help me ; what should

  • Automator Find Finder Items

    I have created an automator workflow to batch import photos into a document from within Word. The workflow works fine and has two processes: Find Finder Items Import Contents into Word Document The problem is when i run this workflow from within Word

  • QI Info record created after PO....

    Dear ALl, QI info record created after PO for the material. SO i wan to know whether system will give error in this case? Regards, Kaushal Rai

  • Rounding in production order quantity

    HI All, My  Production orders are coming in fraction, requirement is in EA , how to set to get a rounded value note : i have maintained assembly scrap in Matl master field Regards Anand Srinivasan