How To open a MS Word/Excel document using Java

How do i open a MS-Word/Excel document using Java Code.

Get SDK (which is freeware) at
http://www.simtel.net/product.php?id=60701&sekid=0&SiteID=simtel.net
http://shareware.pcmag.com/product.php?id=60701&SiteID=pcmag
http://downloads.suntimes.com/product.php?id=60701&SiteID=suntimes
There you will find examples for MSWord and Excel (example sources are packed with binaries).

Similar Messages

  • How to open an MS-Word-File from a Java-Applikation ?

    Hi,
    i want to open an MS-Word-File from a Java-Applikation.
    Something like this:
    File myFile = new File("myFile.doc");
    myFile.open(); //unfortunately this methode doesn't exist
    Thanks for response

    In my opinion you have to use the Runtime.exec(String) method. I do not know the program name for msword.
    You can open a file in notepad by invoking the method Runtime.getRuntime().exec("notepad c:/xyz/abc.txt");
    Runtime runTime = Runtime.getRuntime();
    runTime.exec("programName" + " " + file);
    Of course the computer on which the program runs must have the application!
    Hope this helps!

  • How to read a .csv file(excel format) using Java.

    Hi Everybody,
    I need to read a .csv file(excel) and store all the columns and rows in 2d arrays. Then I can do the rest of the coding myself. I would like it if somebody could post their code to read .csv files over here. The .csv file can have different number of columns and different number of rows every time it is ran. The .csv file is in excel format, so I don't know if that affects the code or not. I would also appreciate it if the classes imported are posted too. I would also like to know if there is a way I can recognize how many rows and columns the .csv file has. I need this urgently so I would be very grateful to anybody who has the solution. Thanks.
    Sincerely Taufiq.

    I used this
    BufferedReader in = new BufferedReader (new FileReader ("test.csv"));
    // and                
    StringTokenizer parser = new StringTokenizer (str, ", ");
                    while (parser.hasMoreTokens () == true)
                    { //crap }works like a charm!

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • How to append in excel sheet using Java

    Can anybody help me out in figuring out as how to append in already existing excel sheet using Java.
    I am able to to write in the existing excel sheet using HSSF but is not able to append the data row wise.
    So plz tell me how to do the same.

    Manisha_7 wrote:
    Thnx for the link......No problem.
    but i alsot wanted to know if apart from using poi there is a way to append the data in excel sheet like using JExcel.Don't know. JExcel is also not apart of Java's core API.

  • How do I open a microsoft Word 95 document in Pages?

    How can I open a Microsoft Word 95 document in Pages?

    The document format is too old. Download the free LibreOffice, and then open this Word '95 document with it. Then export to a different filename.doc, or filename.docx, and then open in Pages.

  • What program do I download to open word excel documents?

    I am not sure what program to purchase to be able to download & print Word & Excel documents.  Thank you for your help!

    You can
    Buy Microsoft Office for Mac (Word & Excel are part of it)
    Download Open Office, Libre Office or Neo Office, all free, all open Word and Excel files
    Buy iWork, Apples office suite, less compatible but excellent.

  • How to create Thumnails images of word/excel documents

    Hi Experts,
    I need java code which can generate thumbnail images of any Word/Excel document.
    I have found code related to creation of thumbnail of any JPEG image.
    Please help me out on this issue. Your suggesions are also appriciated

    Hi i dont know,but you can giave a look to Jakarta POI that can have a awt preview for Excell document,or you can try to replicate your document with Jasper,design a pdf like your word or excell document , and use the AWTPreview.
    Are only suggestion!

  • Add a MS Word/Excel document to a Calender Event.

    How do I add a MS Word/Excel document file to a Calendar Event so that it can be saved in the Calendar Event? In MS Outlook you just either copy or add the file to the Event and save.

    If it's simple text, I'd copy-and-paste the content into an Event (you have to create it first :-( ) or add the file's URL to the Event. But AFAIK Lightning doesn't let you attach files to Events.
    If you do insert an URL, you may have to think about placing the linked document somewhere where you can get at it regardless of your location. Google Docs, Dropbox or similar, perhaps.
    MS products do enjoy tight integration, but then each is privy to the innermost workings of its stablemates and they can use proprietary protocols and interfaces to communicate with each other. OTOH, they don't share too easily with third party software. If that degree of tight integration is important to you, you need to decide for yourself if it's worth paying for. Speaking for myself, I am mean; I'm happier with a hotch-potch of not-very-well-integrated free open source tools. Thunderbird, Firefox, Libre Office. Oh, and Linux. ;-)

  • View word/excel documents in ITS

    Hi,
    Have any of you come across the following...
    In transactions like FBV3, we can attach word/excel documents with a sap document. We can then view these documents. When I try to view the attached documents through Portal and ITS, I get a 'Select Program' dialog box from windows. I then have to find and select 'excel.exe' or 'word.exe' from program files for the attachment to open. Is there anyway to avoid the windows dialog ...
    Thanks,
    Smitha

    If you wanted to role the execookie.txt file out to your user community, assuming they all use Internet Explorer, you could role a file which lets IE determine which application to launch. The following file worked for me:
    TXT
    c:\Program Files\Internet Explorer\iexplore.exe
    JPG
    c:\Program Files\Internet Explorer\iexplore.exe
    JPEG
    c:\Program Files\Internet Explorer\iexplore.exe
    GIF
    c:\Program Files\Internet Explorer\iexplore.exe
    DOC
    c:\Program Files\Internet Explorer\iexplore.exe
    BMP
    c:\Program Files\Internet Explorer\iexplore.exe
    PDF
    c:\Program Files\Internet Explorer\iexplore.exe
    TIF
    c:\Program Files\Internet Explorer\iexplore.exe
    PPT
    c:\Program Files\Internet Explorer\iexplore.exe
    PPS
    c:\Program Files\Internet Explorer\iexplore.exe
    XLS
    c:\Program Files\Internet Explorer\iexplore.exe

  • Import Word/Excel document option greyed out

    For a class assignment I am instructed to import a Word document using Import -> Word Document.  The problem is that the option to import Word & Excel documents is greyed out.  Yes, I have the destination file open when I try to import the document.  This does not change even if I create a new, blank HTML file and try to import the document into that file.
    My system:
    Dreamweaver CS5
    Microsoft Office 10
    Windows 7
    64-bit processor
    Could this be an incompatability with 64-bit system?  That's the only thing that's out of the norm on my computer.  Is there something that I can change to make this option work on my system?
    Thanks.
    Heather

    hmossfry wrote:
    Ok - I received a response from tech support (it's been a while, but I figured that this might be helpful to someone else with this issue).
    Drumroll, please:
    "Office 10 came out after Dreamweaver CS5 & is not supported"
    Unfortunately, the free Adobe technical support is staffed by who are not technical experts. The answer that you received is complete nonsense.
    Office 10 is the XP version of Microsoft Office, which was released in 2002. Office 2010 is actually Office 14.0.
    Like you, I have Windows 7 64-bit. I also have Office 2010 installed.
    I have just created a test document in Word 2010, and saved it on my desktop. I then opened Dreamweaver CS5, made sure the focus was in Design view, and then selected File > Import > Word Document. The file was correctly imported.
    As I said before, it's important for the focus to be in Design view. The following screenshot shows an attempt to access Import > Word Document when the focus is out of Design view. The option is greyed out.
    I then clicked inside Design view to ensure the focus was in the correct place. As the following screenshot shows, the options for Word and Excel are no longer greyed out.
    Importing Word documents in Dreamweaver CS5 on Windows 7 64-bit definitely works with Word 2010. If it's not working on your system, there's a problem with your installation. It's not a bug in Dreamweaver or lack of support for Office 2010.

  • How can I convert my word perfect documents to mac?

    how can I convert my word perfect documents to mac?

    Hello fruhulda.
    Before writting that, I checked the openOffice Save dialog.
    And one more time, michaelfromrochester write about what he isn't aware.
    The fact that abiwork open Wordperfect documents doesn't prove that openoffice doesn't.
    The link posted by Tom claims that it does.
    I repeat my request:
    I wish to receive a sample file to check if the embedded importer really works.
    About zamzar, I would never use an online service to translate/transcode an important document.
    Yvan KOENIG (VALLAURIS, France) 16 mai 2011 09:34:15

  • Hi there, i have Q i have excel file it need to be block with password. Could you please explain how i make password protect to Excel document

    Hi there,
    i have Q i have excel file it need to be block with password. Could you please explain how i make password protect to Excel document
    Thanks

    On the File menu, click Save As.
    On the Tools menu, click General Options.
    Do either or both of the following:
    If you want users to enter a password before they can view the workbook, type a password in the Password to open box, and then click OK.
    If you want users to enter a password before they can save changes to the workbook, type a password in the Password to modify box.
    NOTE   Unlike passwords you specify in the Password to open box, passwords you specify in the Password to modify box are not encrypted. These passwords are only meant to give specific users permission to modify workbook data. For optimal password security, it's best to assign both passwords. An encrypted password to access the workbook, and one to provide specific users with permission to modify its content. IMPORTANT   Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.
    If you want to use a different encryption type, click Advanced, click the type you want in the Choose an encryption type list, and then click OK.
    If needed, specify the number of characters you want in the Choose a key length box.
    NOTE   Document property encryption is enabled by default for most encryption types and providers. It prevents unauthorized users from viewing summary and custom file properties (such as the author or any custom file information) in theProperties dialog box. When users right-click the password-protected file, and then click Properties, information won't be available on the Summary tab and Customtab. Authorized users, however, can open the file and view all file properties (Filemenu, Properties command). To disable document property encryption, clear theEncrypt document properties check box.
    Click OK.
    When prompted, retype your passwords to confirm them.
    Click Save.
    If prompted, click Yes to replace the existing workbook.
    NOTE   You can also secure a workbook with a password on the Security tab of the Options dialog box (Tools menu, Options command).

  • Opening an Excel document using I_OI_DOCUMENT_PROXY

    Hi,
    I'm currently opening an Excel document using the OPEN_DOCUMENT method of the I_OI_DOCUMENT_PROXY interface. A macro is then run to populate specified columns in the spreadsheet and then proceeds with printing the document.
    Within Excel, we've set Application.ScreenUpdating = False, which hides the document from the user. When launching the document directly from the local drive (not from SAP), it doesn't get displayed.
    However, calling it from SAP seems to bring up Excel, and it shows the processing of the macro as well as the automatic printing and only then will Excel close.
    My question is, is there anyway we'd be able to run the Excel macro and print the spreadsheet without Excel ever opening at all?
    Thanks and regards,
    Adeline.

    Hi,
    I'm currently opening an Excel document using the OPEN_DOCUMENT method of the I_OI_DOCUMENT_PROXY interface. A macro is then run to populate specified columns in the spreadsheet and then proceeds with printing the document.
    Within Excel, we've set Application.ScreenUpdating = False, which hides the document from the user. When launching the document directly from the local drive (not from SAP), it doesn't get displayed.
    However, calling it from SAP seems to bring up Excel, and it shows the processing of the macro as well as the automatic printing and only then will Excel close.
    My question is, is there anyway we'd be able to run the Excel macro and print the spreadsheet without Excel ever opening at all?
    Thanks and regards,
    Adeline.

  • Hi there, I currently subscribe to Adobe Pro Subscription (yearly) and I also subscribe to Adobe PDF pack (monthly).  I only require Adobe to read and create PDF documents such as converting word/excel document or a web based document.  Can someone tell m

    Hi there, I currently subscribe to Adobe Pro Subscription (yearly) and I also subscribe to Adobe PDF pack (monthly).  I only require Adobe to read and create PDF documents such as converting word/excel document or a web based document.  Can someone tell me if I'm doubling up as I'm not sure of the differences between the products and would like to save a few dollars.

    Acrobat Pro can do a lot more than the PDF Pack online service.
    Try if you can do everything you need with PDF Pack; otherwise keep Acrobat Pro.

Maybe you are looking for