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

Similar Messages

  • 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

  • Upload / Open a Word Document from BDS with WebDynpro

    Hello,
    we use the BDS (Business Document Server) to storage our word files. Now we use WebDynpro with the UI OfficeControl.
    Could any one tell me, how to open/upload my documents from BDS with the OfficeControl.
    The UI FileUpload does not work, because it is not allowed to use specify URLs. link:[http://help.sap.com/saphelp_nw70/helpdata/EN/b3/be7941601b1d09e10000000a155106/frameset.htm]
    For example that is the URL from the BDS: "SAPR3://SAPR3CMS/get/100/BDS_5FDB2_5FR/7B3AAF5B22AAD21197ED0060B0672A3C/Forminterface.doc"
    I use the class "CL_BDS_DOCUMENT_SET" with the method "get_with_url". result is above.
    Each example with the OfficeControl from SAP (Package SIOS) use the Mime Repository:
    mime_repository = cl_mime_repository_api=>get_api( ).
      CALL METHOD mime_repository->get
        EXPORTING
          i_url     = url
        IMPORTING
          e_content = content.
      wd_context->set_attribute( name = 'DATAS' value = content ).
    Have any one an idea, how BDS and WebDynpro works together

    What about getting the binary of the word document from BDS and download this?
    Yes, it exist a method calls "get_with_table". This return the binary path from my url above.
    Here is my source code:
    public attributes
    DATA oi_document TYPE REF TO if_ios_wordprocessing.
    DATA oi_factory TYPE REF TO if_ios_factory.
    METHOD wddomodifyview .
    DATA ol_node TYPE REF TO if_wd_context_node.
    DATA ol_office TYPE REF TO cl_wd_office_control.
    DATA vl_document TYPE xstring.
    short from
      vl_document = myBDS->get_with_table( ).
    Settings for UI OFFICE_CONTROL
      ol_node = wd_context->get_child_node( 'OFFICE' ).
      ol_node->set_attribute( name = 'DATASET' value = vl_document ).
    get the office control
      wd_this->oi_office ?= view->get_element( 'OFFICE_CONTROL' ).
    get the IOS Factory
          wd_this->oi_factory ?= ol_office->_method_handler.
    get proxy document
          wd_this->oi_factory->get_wordprocessing_proxy(
          IMPORTING proxy = wd_this->oi_document  ).
    CALL METHOD wd_this->oi_document->if_ios_document~opendocument( ).
    ENDMETHOD.
    When I compile everything is ok. But when I run my application, it nothing happen. No word file is opening or no error message. I create a ALC trace (SAPNOTE 949770).
    Each time when I try to open my word file comes a popup-window from the alc-trace:
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::| STG_E_READFAULT  : readaccess|HRESULT=-2147287010(     A disk error occurred during a read operation)
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::|Office version is lower than 12, only native office format supported|HRESULT=-2147467259(Unspecified error
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::|loadOffice2007xml|HRESULT=-2147467259(Unspecified error )
    But I have access to the BDS and to the document.
    Can any one help me.....
    Regards
    Nils

  • Opening a Word Document with a Java program in Windows

    When running a Java program in Windows, is it possible to have a button where when it is clicked it will open a Word document?
    If so, is it hard and can someone tell me how to do it??
    Thanks

    try this instead of Excel.exe you have to use Word.exe
    1. Declare your button
                   JButton butexlcom = new JButton("Carnet Offre");
                   butexlcom.addActionListener( new ButExlCommercial(msgout));
                   butexlcom.setBounds(215,510,110,30);
                   c.add( butexlcom );
    2. run your word document.
    class ButExlCommercial implements ActionListener {
         private JTextArea msgout;
         public ButExlCommercial( JTextArea msg) {
         msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
                   Runtime.getRuntime().exec("c:\\Program Files\\Microsoft Office\\Office\\Excel.exe NameWordDocument");
              catch(Exception en) {
                   msgout.append( "\n*** PROBLEME WORD ***\n" );
    }

  • How do you run a (Word) Document from a Swing application

    I want to create a Word Document and then open it from a Swing application. If you can't do that directly, what else can you do to get that result.

    gwils wrote:
    How do you recover a word document on a macbook pro?
    Just as you do it on a Mac Pro or a Mac Mini.
    What version of Mac OS X? What version of MS Word?
    If you're thinking of the AutoRecover feature, you have to enable it first. If it was enabled, this
    <http://kb.iu.edu/data/ahnd.html#FindingfilesMac>
    will tell you what to do.

  • How do I open a word document from a url?

    We have a document server and I need to open a MSWord document that is a template for LabView to populate (using bookmarks and Connectivity Toolkit).
    I have looked at the URL builder and I can't get that to work.  The Get Document does open the document but it doesn't seam to give the correct path to the Word Get Report so it doesn't give a good link.
    I can open it in the default browser which links to Word but again there isn't any link to feed to Word Get Report.
    Am I even close?
    Thank you,
    Ben
    Solved!
    Go to Solution.

    Here's a code snippet that should help you:
    It:
    initializes a HTTP session with a username and password,
    generates a random, non-existent filename with a doc extension
    Get's a file on URL to the temporary filename
    Closes the HTTP session
    Starts the Report Generaton Toolkit, with the file from the web as the template
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Help about opening a PHP page from a Java application

    Hi,
    I would have some elements to open a PHP page from a little Java application I'm doing. I would like to know the classes I had to use, how to implement them, ...
    In fact, I dial into my application my login, my password, and when I click on by "Connect" button, I must show the PHP page corresponding ti my profile onto the database. Picking up information from the database is not a problem, I know how to use SQL Packages in Java. The problem is to open a new page (IE or Netscape) when clicking on the "Connect" button in my application.
    Thanks a lot for advice me.
    C�dric

    Hi
    This class is from JavaWorld Tip 66 and I've used it to open web pages and files in a browser.
    import java.io.IOException;
    import java.util.*;
    * A simple, static class to display a URL in the system browser.
    * Under Unix, the system browser is hard-coded to be 'netscape'.
    * Netscape must be in your PATH for this to work.  This has been
    * tested with the following platforms: AIX, HP-UX and Solaris.
    * Under Windows, this will bring up the default browser under windows,
    * usually either Netscape or Microsoft IE.  The default browser is
    * determined by the OS.  This has been tested under Windows 95/98/NT.
    * Examples:
    BrowserControl.displayURL("http://www.javaworld.com")
    BrowserControl.displayURL("file://c:\\docs\\index.html")
    BrowserContorl.displayURL("file:///user/joe/index.html");
    * Note - you must include the url type -- either "http://" or
    * "file://".
    public class BrowserControl
         * Display a file in the system browser.  If you want to display a
         * file, you must include the absolute path name.
         * @param url the file's url (the url must start with either "http://"
    or
         * "file://").
        public static void displayURL(String url) throws Exception
            boolean windows = isWindowsPlatform();
            String cmd = null;
            try
                if (windows)
                    // cmd = 'rundll32 url.dll,FileProtocolHandler http://...'
                    cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
                    Process p = Runtime.getRuntime().exec(cmd);
                else
                    // Under Unix, Netscape has to be running for the "-remote"
                    // command to work.  So, we try sending the command and
                    // check for an exit value.  If the exit command is 0,
                    // it worked, otherwise we need to start the browser.
                    // cmd = 'netscape -remote openURL(http://www.javaworld.com)'
                    cmd = UNIX_PATH + " " + UNIX_FLAG + "(" + url + ")";
                    Process p = Runtime.getRuntime().exec(cmd);
                    try
                        // wait for exit code -- if it's 0, command worked,
                        // otherwise we need to start the browser up.
                        int exitCode = p.waitFor();
                        if (exitCode != 0)
                            // Command failed, start up the browser
                            // cmd = 'netscape http://www.javaworld.com'
                            cmd = UNIX_PATH + " "  + url;
                            p = Runtime.getRuntime().exec(cmd);
                    catch(InterruptedException x)
                        System.err.println("Error bringing up browser, cmd='" +
                                           cmd + "'");
                        System.err.println("Caught: " + x);
                        throw x;
            catch(IOException x)
                // couldn't exec browser
                System.err.println("Could not invoke browser, command=" + cmd);
                System.err.println("Caught: " + x);
                throw x;
         * Try to determine whether this application is running under Windows
         * or some other platform by examing the "os.name" property.
         * @return true if this application is running under a Windows OS
        public static boolean isWindowsPlatform()
            String os = System.getProperty("os.name");
            if ( os != null && os.startsWith(WIN_ID))
                return true;
            else
                return false;
         * Simple example.
        public static void main(String[] args)
          try
    //        displayURL("file://c:\\Manual\\Amphibian Accounting Help Test 3.pdf");
    //        displayURL("http://www.pro7.co.za");
            Properties prop = System.getProperties();
    //        Enumeration enum = prop.propertyNames();
            Enumeration enum = prop.keys();
            while(enum.hasMoreElements())
              enum.nextElement();
          catch(Exception e)
        // Used to identify the windows platform.
        private static final String WIN_ID = "Windows";
        // The default system browser under windows.
        private static final String WIN_PATH = "rundll32";
        // The flag to display a url.
        private static final String WIN_FLAG = "url.dll,FileProtocolHandler";
        // The default browser under unix.
        private static final String UNIX_PATH = "netscape";
        // The flag to display a url.
        private static final String UNIX_FLAG = "-remote openURL";
    }If you find a better solution please let me know!
    Regards
    Michael Williams

  • How to open a Word Document from Developer Forms

    Hi Buddies,
    Can anybody help me out in this regard.
    My requirement is like this.
    In my developer Forms Screen i have one button named resume.
    if i click that button then that particular persons resume has to be opened which is MsWord file(.DOC)located in server(Which is the database server).
    So we have to launch the word with the required document using the Forms built-ins. The document path will be stored in my database.
    Quick response will be appreciated.
    Thanks in Anticipation
    Regards
    Kiran Kumar Jasti

    Hi Kiran,
    host('winword.exe <pass ur resume path>');
    hope this could work out....just try...good luck
    Regards
    Thobula Rakesh

  • How to open a word document from OA page

    Hi,
    I have a requirement where in the file names are displayed in a table .When the user clicks on the file name the file should open .The docs are basically word docs.
    Any idea how to implement this.
    I saw a post related to this in which someone suggested to use symlinks in Apache.Not sure how to do that.
    Thanks
    Anna

    Hi Kiran,
    host('winword.exe <pass ur resume path>');
    hope this could work out....just try...good luck
    Regards
    Thobula Rakesh

  • 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 ??

  • Searching a string in Microsoft word from a Jav Application

    Would appreciate if you could provide me with an example/ suggestion to search for a string in Microsoft Word document from a java aplication. Thanks

    Short and rude answer: STFW.
    Long and polite answer: If you use "java apache word excel" as the criterium to search the web with Google, the first hit is what we are looking for:
    http://jakarta.apache.org/poi/
    Good luck anyway!

  • I am using Macbook Pro and Microsoft Office for Mac 2011, it fails to open word documents while other office application are functional.

    I have been using my Macbook Pro for more than 2 years. Suddenly the Mac fails to open any word documents while other microsoft application are operational.

    Dear Kilted Tim
    Thank you for assisting me resolve my problem. It was successful resolved through updating the software.
    Petrus

  • Opening PC WORd documents with AW

    I am new IMAC user. Unfortunately salesman (Best Buy) told me that a word processor and spread sheet were part of the software package! I want to buy AW (sounds like a great program and my son loves it), but need to know how to open PC Word documents from email. Will I be able to do this?
    Thanks.

    As Roger said, AppleWorks may not open newer Word & Excel files, from a PC or Mac. In the past, AppleWorks 6 was able to open almost all Word & Excel documents, it is not able to open those saved with newer versions of either Mac or PC application. The Office translators in AppleWorks were introduced in late 2000 or early 2001 & have not been updated. In the meantime, Microsoft has made significant changes in the file formats in the last year or two that AppleWorks can't open them any more. AppleWorks 6 was released in March, 2000, & hasn't even had any kind of update since January, 2004.

  • How to open a word document in dynpro

    Hi experts,
    i am new to web dynpro, i have a problem that i need to open a word document from desktop in my screen. its not ALV or i dont have to upload the file but i have to OPEN the file..
    plz help
    Regards:
    Parteek

    Hi Manu,
    Follow these steps:
    1. Create CONTEXT with 2 attributes - UPLOAD & SHOW of type XSTRING.
    2. Add a "UPLOAD" element on the layout of screen & map it with UPLOAD attribute of context.
    3. Then Add a "OFFICE CONTROL" on the same screen & map it with the SHOW attribute of context..
    4. Add a BUTTON for Show Document/Open Document.
    5. Add 2 attrubutes in ATTRIBUTES tab of the dynpro application:
            i) DOCUMENT type IF_IOS_DOCUMENT
           ii) FACTORY    type IF_IOS_FACTORY
    6. On method of that button (SHOW)...enter the following code:
    DATA : refexp TYPE REF TO cx_ios_exception.
    IF wd_this->document IS INITIAL.
        wd_this->factory->get_document_proxy( IMPORTING proxy = wd_this->document  ).
        ASSERT ID sios_demo CONDITION wd_this->document IS BOUND.
      ENDIF.
      wd_this->document->opendocument( ).
    read context node
    DATA:
        node_file_upload                    TYPE REF TO if_wd_context_node,
        elem_file_upload                    TYPE REF TO if_wd_context_element,
        stru_file_upload                    TYPE if_second=>element_file_upload .
    navigate from <CONTEXT> to <FILE_UPLOAD> via lead selection
      node_file_upload = wd_context->get_child_node( name = if_second=>wdctx_file_upload ).
    get element via lead selection
      elem_file_upload = node_file_upload->get_element(  ).
    get all declared attributes
      elem_file_upload->get_static_attributes(
        IMPORTING
          static_attributes = stru_file_upload ).
      stru_file_upload-show = stru_file_upload-upload.
    set all declared attributes
      elem_file_upload->set_static_attributes(
        EXPORTING
          static_attributes = stru_file_upload ).
    7. Now add the following code to the WDDOMODIFYVIEW method (default method)
      DATA:
          office TYPE REF TO cl_wd_view_element.
    get the office control
      office ?= view->get_element( 'OFFICE' ).
      ASSERT ID sios_demo CONDITION  office IS BOUND.
    get the IOS interface
      wd_this->factory ?= office->_method_handler.
      ASSERT ID sios_demo CONDITION wd_this->factory IS BOUND.
    8. Run the application & enter a text file of word format in the File Upload.
    9. Press show button & it will display the code of that word file.
    Plz ask any queries if you face any problem doing the above code.
    & dont forget to mark Points.
    Regards:
    Parteek.
    Edited by: Parteek Arora on Jan 23, 2008 9:05 AM

  • Can you open a word document in pages 08

    Quick question however stupid it is
    can you open a word document from a pc in pages 08?
    sorry in advance if i have posted this in the wrong discussion area
    cheers
    Message was edited by: Lama323

    The answer is as above wrote yes. Does it do it perfectly, the answer is no. Opening a .doc/.docx in Pages'08 will generate a frame warning message I find. I find text and symbols are preserved well, but formatting is not perfect. An example of my own is in the screenshot below. Same page 28 on a .docx but formatting of the document is not exactly preserved as you can clearly see. Where preservation of formatting is critical Pages is good, but not perfect alternative to Word '08.
    http://img225.imageshack.us/img225/2461/docxcu2.png

Maybe you are looking for

  • Cinema Display 24" won't work with Mac Mini 3.1

    I recently purchased a refurbished Apple LED Cinema Display 24" from a buddy.  I'm pairing it with my used Mac Mini 3.1 (2009?). The display port mini connections seem to match.  The USB is plugged in.  The only cable unused is the "macbook power" pl

  • Upgraded to Hotsink 4.1 version, Can't import back-up files.

    Zire21/Windows Vista My first gripe is that the hotsink upgrade software never had any kind of warning that the handheld should be hotsinked and archived prior to installing the upgrade. I figured that Palm was advanced enough to self-import the back

  • SCN T-Shirts.

    Hi Is SCN provides T-shirts same like SDN.? I know SDN was giving once crossing respective milestones like 250, 1000, 500 pints... etc Did anybody got t-shirt recently..? Reg, Bhg

  • NullPointerException in ensureAppRedeployment

    I get a null pointer exception from ensureAppRedeployment in the console upon rebuild then redeploy of my portal app. If i just change a file, or undeploy/redeploy, I do not recieve the error. Does anyone know what this is or how to resolve this? A s

  • Failing gsm/3g/2g network connection

    I have a wheird problem with my n900 since Sunday. When I'm at home, I can't reach the network (although I've seen it connecting for a short moment) When I put it another sim card (other provider) my connection is ok. BUT when I walk some 50meters, I