HOW TO OPEN WORD DOCUMENT FROM JAVA???

hi everyone! Can you please help me to come with this problem? Let me to set my main target I want to achieve:
1) In my program user should first press a button;
2) Then already created Word Document should be opened (I DO NOT NEED to open that Word Document in Java or something like JField). Just simply it should be opened as a Microsoft Word Document.
I DO NEED YOUR HELP! PLEASE HELP ME....!

Running cmd using the exec is also a windows only solution, there is no "more" or "less" it that solution compared to the rundll.
Since word is a windows format its pretty obvious that the application is ran under windows platform.
If you are running on a different platform (maybe using open office you can open word documents, i'm not sure) you might want to use the JDIC library (https://jdic.dev.java.net/) which enables you to open/edit/browse such files using the default viewer/editor/browser of the system you are working on.
Look at the org.jdesktop.jdic.desktop.Desktop object for these methods.
You can also find the Desktop object in J2SE6 but its still in beta.

Similar Messages

  • How to open Word Document using java?

    Respected Sir/ Madam,
    I am doing my project in Network Security using java. I have to transfer the files from server to the client. Each transferred file should have some of the access privileges such as read, write and exeucte. If the transferred file is a word document means then automatically the client should open Microsoft word and if the file is having Read Permission alone then the save, Save As, cut,copy, paste options in the MS - Word should be disabled. This is similar for all the files that i have transferred. That is if the transferred file is excel, audio, video,txt file the corresponding application should be opened properly. How could I acheive this. If the file is having write permission then if the user clicks the save option then the contents of the file should be saved in the server machine not in the client machine, Could we achieve this???? Can anyone help me regarding this? Please give me your views about this query?

    Respected Sir / Madam,
    Thank you very much for your reply. Could we use Microsoft API inside java program to achieve my doubts?? Could U explain it more????

  • How to open word document from application server?

    hello ,
    I want to open a word document that is placed on the application server.
    the function module 'ws_execute' works fine for displaying documents placed on ur local file system. But if i want to open from application server, what needs to b done?
    i m referring to the following demo program 'SAPRDEMOOFFICEINTEGRATION'
    is this the correct reference or there is some other way to do the same?
    kindly help.
    Regards,
    Roshani

    Hi Roshani,
              The solution is like this.
    1> Execute - this is the solution to your program. The file is generated and put in the Application Server for the data to be sent by some means to the intended Place.
    2> To Display/View - This is for the person (who runs the program) to view if the output generated is correct or not.
             So to accomplish this use the same internal table for both Open Dataset and Gui download.
    Open dataset puts data onto the Application server and Gui_download puts the data onto the Desktop or Presentation server for the user to see the data thats fetched.
    So use them as directed to achieve the desired output.
    Reward Points.
    Thanks,
    Tej..

  • I can't open word documents from Finder

    I can't open word documents from Finder

    If you mean "I can't double click a *doc file and make word open" then you highlight the file and do a command-I (or get info).  When the window comes up, change the "open with" parameter.  You can also right click and select "other"

  • Open word document from oracle forms 10g

    Hi,
    Could any one please guide me how to open a word document from forms 10g on client machine (windows). My word document resides on application server (unix).
    Thanks for the help in advance.

    I tried that, but it doesn't work.
    What I have done is, I have written a java code that has a function ope_word that opens up a word document. I have created jar out of it called wordbean.jar.
    Add this wordbean.jar in $ORACLE_HOME/forms/java directory and also added in the formsweb.cfg file (archive_jini=wordbean.jar)
    Then I created a form and usinf fbean.register and fbean.invoke functions of forms, I am trying to call wordbean.jar.
    F.bean.register is registering all the components of wordbean.jar but it is not opening the word document.
    Could you please help ??

  • How to open word document form html container url iam getting internal_error while opening file

    Hi all,
    By using below code i am able to download word document file from html container. But before downloading i need edit these document to add Macro.
    I am unable to open word document.
    CREATE OBJECT G_HTML_CONTAINER
          EXPORTING
            CONTAINER_NAME = 'PDF'.
       CREATE OBJECT G_HTML_CONTROL
          EXPORTING
            PARENT = G_HTML_CONTAINER.
    * Convert xstring to binary table to pass to the LOAD_DATA method
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            BUFFER     = LV_CONTENT
          TABLES
            BINARY_TAB = LT_DATA.
    data_tab = LT_DATA ).
    * Load the HTML
        CALL METHOD G_HTML_CONTROL->LOAD_DATA(
           EXPORTING
             TYPE         = 'application'
             SUBTYPE      = 'DOC'
           IMPORTING
             ASSIGNED_URL         = LV_URL
           CHANGING
             DATA_TABLE           = LT_DATA
           EXCEPTIONS
             DP_INVALID_PARAMETER = 1
             DP_ERROR_GENERAL     = 2
             CNTL_ERROR           = 3
             OTHERS               = 4 ).
    * Show it
        CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL
          IN_PLACE = 'X' ).
    Before file download i want edit the file for that i am using below class.
    PROXY TYPE REF TO I_OI_DOCUMENT_PROXY.
    by using (get_document_proxy) method  getting proxy .
    call method control->get_document_proxy
    exporting
    document_format   = 'x'
    document_type      = 'Word.Document'
    register_container  = 'x'
    importing
    document_proxy     = proxy
    after these.
    call method proxy->open_document
    exporting
    document_url    = lv_url
    open_inplace    = 'x'
    hear i m getting retcode as INTERNAL ERROR
    can any one suggest me how to open document from html container.
    Thanks and reagards
    jogu yadav

    I got resolution
    Thanks and regards,
    Jogu yadav

  • How to open word document in labview

    Hi,
    I want to open word document in labview,well i have done that.
    I want to display only the page part,don't want any editions,formatting to be done.
    please suggest me solution if any.

    How are you displaying your Word document, have you achieved that already?
    As far as I know, there is only one way to display Word documents and that's through the browser ActiveX interface:
    Using the Microsoft Web Browser control to embed a Word Document in LabVIEW
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • How to open word document directly using ole2 and ole containers

    Hello
    i am using ole conatiners....in forms 6i. i want o open word document directly when i click a button....
    i have tried host....ole but word opens .....i want the document to open at once.....
    what should i use /set
    plz tell by host command and ole2 as well
    its urgent.....
    thanks

    Try this code, Hope this will work.
    declare
    item_name varchar2(80) := 'letter';
    item_id item;
    verb_index_str VARCHAR(20);
    verb_index PLS_INTEGER;
    verb_cnt_str VARCHAR(20);
    verb_cnt NUMBER;
    verb_name VARCHAR(20);
    loop_cntr NUMBER;
    begin
    item_id := Find_Item(item_name);
    IF Id_Null(item_id)THEN
              message('No such item: '||item_name);
    ELSE
    verb_cnt_str := Forms_OLE.Get_Verb_Count(item_id);
    verb_cnt := TO_NUMBER(verb_cnt_str);
    FOR loop_cntr in 1..verb_cnt LOOP
    verb_name := Forms_OLE.Get_Verb_Name(item_id,loop_cntr);
    -- message(verb_name);
    -- message(loop_cntr|| ' '||verb_name);
    IF verb_name = 'Open' or Verb_name = '?E?'THEN
    EXEC_VERB(item_id,verb_name);
    END IF;
         end loop;
    end if;
    EXCEPTION
    WHEN OTHERS THEN
    MESSAGE('Error: '||TO_CHAR(SQLCODE)||' '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE;
    end;

  • How to open word doc. from forms 10g

    hi all
    i am trying to open word doc. from forms 10g using ole2.
    but it is not working.
    basiccaly this command is not working
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    can anybody help
    thanx

    I found this searching this forum and it works..however, my issue is to open up Microsoft Word passing in data from a query.
    I am working on Forms 10g
    DECLARE AppID PLS_INTEGER;
    BEGIN
    AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\OFFICE11\winword.exe C:\test.doc',
    DDE.APP_MODE_NORMAL);
    END;

  • Need to open word document from flash projector on Windows and Mac

    Hello,
    I'm creating a flash program that will be put on a dvd. And the dvd should function well on both windows and mac.
    I'm trying to open a word document on click of a button. I used geturl but it works only on windows but on mac it only opens a blank browser.
    This is urgent and would be really grateful if I get any help to resolve this problem
    Thanks,
    Sunira

    I kind of doubt you could get Safari to open MS Office files. Short of actually getting MS Office for the Mac, the most workable option might be to get NeoOffice/J (a Mac-friendly version of OpenOffice from http://www.planamesa.com/neojava/en/index.php. It won't display some Office files 100% correctly (depending on how complex they are) but it can open and save them.

  • Open Word Document from ITS

    Hey,
    i want to open a Word Document "write protected" via ITS, until now I used the FM ALEWEB_DOWNLOAD". The combination of GUI_DOWNLOAD and WS_EXECUTE works, but the document is opened in the "normal" mode and before the word application opens I get a popup requester window.
    I would like to reach the Word application on the client by OLE2 but i don't know how this works through the ITS?
    Has anybody experience with this problem?
    Thank you!
    Greets
    Christof

    Hey,
    unfortunetaly I get an exception. But I'm not sure if my question was clear enough.
    I want to open an application on a client through the web browser.
    I use generated SAP WEB GUI screens which look like the SAP GUI. A double click on the result list in the web browser should open an application (word) on the client and display a document.
    This works so far with the function module 'ALEWEB_DOWNLOAD' but causes some other problems, thats why I'm trying to find an alternative.
    I think that using the class 'cl_gui_frontend_services' the server looks for the application on the ITS and not on the client. But I'm not sure at all.
    Thanks a lot!
    Christof

  • How to generate Word document from JSP ?

    Hi,
    I want to generate Word documnet from JSP. I am using Neva objects to generate Word document. Now my problem is Word doc generation code works alright as a Java application but when I place that piece of code in a JSP bean it throws an exception. The reason seems to be unavailibility of DLLs and other files of Neva in Tomcat environment. I do not want to use other complex packages like JIntegra, I would prefer any freeware solution. There is not much info. about Word document generation on POI project in Jakarta site.
    Could anyone suggest way out ? Any Java examples doing the same would be of great help.
    Thanks,
    Akash

    Hi Saurabh,
    Thanks for the reply.
    I have tried that too. Problem with that solution is that if you have used CSS in your JSP code MS word does not understand it and generates word doc which is not the same as HTML which JSP otherwise would have generated.
    Akash

  • How to open "word" document

    I had some old Word documents on a Dell laptop that I wanted to view on my iMac.  Using a USB drive, I successfully transferred the files from the Dell to the iMac.  Some of the documents open up normally for viewing, etc.  Others do not.  A Pages box pops up and says the document can't be opened.  These are all Word documents, so I'm puzzled why some will open and others won't.  Is there a way to convert these "problem" documents to jpegs?

    These are old Word documents 1999-2000 mostly.  I only have Word on the laptop.  It's old and I'm planning on "decommissioning" it, if you catch my drift.  As I said, some of them open without any problem, while others do not.  What's a fella to do? :-)

  • Open word document from APEX

    Evening folks!
    I am new to APEX and I've struggled thus far so this forum has been a life-saver.
    I'm hoping there is a solution to my new problem ;-)
    I have successfully exported data from APEX to csv (HUGE thanks to the spendolini blog) and I can use that csv file as a data source for a mail-merge word document, but I have a couple of questions:
    1. I'd like the csv file to save to a specified location without prompting the user to open, save etc. Is this possible?
    2. I'd like to open a specified mail-merge word document automatically from within my APEX application. Is this possible?
    To explain, ideally I would like the user to click on the export button and it save the data to a specified csv file automatically and then automatically open a specified mail-merge word document.
    Many thanks in advance.
    Winnie

    Exporting a .csv to a directory instead of prompting user to save the file is done using
    a similar function:
       PROCEDURE export_to_csv (p_directory IN VARCHAR2, p_filename_in VARCHAR2)
       IS
          v_file   UTL_FILE.file_type;
          CURSOR c_emp
          IS
             SELECT empno, ename, job
               FROM emp;
       BEGIN
          v_file := UTL_FILE.fopen (p_directory, p_filename_in, 'W');
          UTL_FILE.put_line (v_file,
                             'EMPNO' || ';' || 'ENAME' || ';' || 'MANAGER'
          FOR c IN c_emp
          LOOP
             UTL_FILE.put_line (v_file,
                                c.empno || ';' || c.ename || ';' || c.job);
          END LOOP;
          UTL_FILE.fclose (v_file);
       END export_to_csv;The cursor is hardcoded here. You could enter your select statement also as a
    parameter and create a "generic" solution, for all purposes.
    I don't know much about mail merge. Others will need to help there.
    Denes Kubicek

  • Open Word Document from Powershell script

    I've created a simple Powershell menu script to launch a few applications with but need to open some word docs as well from this script. I've tried several options and can get word to open but have not been able to get it to open a specific document. Just
    need the proper code to launch MS word and open a specific word document located on my network share. Any takers??????? :)

    You can just specify the path to the Word file and it should open it as long as the file associations are correct.
    "\\server\share\path\wordfile.docx"
    If you found this post helpful, please "Vote as Helpful". If it answered your question, remember to "Mark as Answer".
    Rich Prescott | Infrastructure Architect, Windows Engineer and PowerShell blogger | MCITP, MCTS, MCP
    [Blog] Engineering Efficiency | [Twitter]
    @Rich_Prescott | [Powershell GUI]
    Client System Administration tool | [PowerShell GUI]
    New AD User Creation tool

Maybe you are looking for

  • Checking to see if files exist not working as expected.

    Hey, so I've set up a script that determines the artist playing on iTunes and sets the background image to a preselected picture of them. I want to expand this to allow different pictures of the artists, and after a few attempts, decided to use a tim

  • Work Center Hierchy

    Dear All, I created a workcenter hierarchy UNIT - 1 and into that assign A1 , A2 , A3 work center now going for a CM01 Transaction to see a available cumulative capacity for that make setting in general tab like Hierarchy , Plant and check tick box C

  • EFT payments

    Hi Everyone, Our client wants to send Electronic Fund Transfers using Idocs/EDI What are the steps involved in configuring fbzp for EDI? What are the steps involved in setting Idocs and EDI to achieve the task? Thanks and Regards, Genie

  • ALERT - Support for Java Critical Patch Update

    ALERT - Support for Java Critical Patch Update On October 15th, Java released a critical patch update (CPU) which will require download and upgrade to the Java Runtime Environment (JRE) release – 1.7.0_45.   If upgrading the JRE to this release, the

  • Crash using block from mutable dictionary

    What can people tell me about why this program crashes: #import <Foundation/Foundation.h> @interface Action : NSObject + (void)execute; @end @implementation Action + (void)execute     NSLog(@"The action was executed."); @end @interface ActionPerforme