Create Word document with Java

I want to create a Word Document with Java. But I don't know how can I insert text in a Word document.

I searched and found JXWord (probably limited to Windows): http://www.geocities.com/picmapicma/
I'm interrested to know if it works fine...:)

Similar Messages

  • Read,write and create word document with list data

    Hi,
    My requirement is that I have a custom list called List1 and which has a 4 (suppose XName, location, phone, email)columns and also have a Template document(.dot). If I click on save button , new document has to create from the Template document(.dot) and
    should modify the content depends on list columns.
    For that I need to read the document , find out the text where XName , location,,phone, email and replace with the list item data(user entered data). 
    Can anybody please refer links for read,write and create word document?
    Thanks in advance.

    Yes, you can using Office Open XML. I found it to be a lot more cumbersome and in the end not a money saving approach:
    https://msdn.microsoft.com/en-us/library/office/bb448854.aspx?f=255&MSPPError=-2147217396
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Api POI read and replace my word document with java

    Hi
    Everyone
    I�d like to know if someone has a piece of code reading a word document with api POI to send me?
    I need read replace the word document wiht java j2ee.
    Thanks

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • Create Word Document with OLE2.

    Hi,
    Is it possible to create a word docuent as an attachment? I want to create an attachment for opportunity when its status changes.
    Is it possible to create word document in Actions and can we attach it to opportunity?
    Any suggestions on how to approach for this requirment?
    Regards,

    Mike is not suggesting that you try to invoke a Word macro from OLE2. He is suggesting that you use Word's Macro Recorder to capture the actions you are trying to automate. The resulting macro will be written in VBA, and therefore of no direct use to you. It will, however, show you which objects/methods are relevant to your task. This information will make it much easier to write the equivalent OLE2 code.
    Note that Macro Recorder tends to generate more code than is necessary, by reassigning default values to object properties, to ensure portability. Your OLE2 code can often be left much more brief, by assigning values only to those properties that actually change within your operation.
    Eric Adamson
    Lansing, Michigan

  • Flagging Word documents with Java???

    Hi everyone!
    We are currently designing an Intranet architecture in J2EE and are looking for a solution to the following problem:
    We are going to create a Word template which all users submitting a document must use in order for this to be accepted. The reasoning behind this is that we are using a pubishing package to convert all documents into HTML and we need to ensure consistent formatting. The problem is how do we ensure that this template is used? What we want to do is somehow 'flag' the original template and allow the framework to check whether the document submitted is flagged (i.e. used the original template). So i guess the question i'm asking here is does anyone know how we might go about this? Is Java able to read Word documents in their native format?
    Many thanks for your help in advance

    Seems to me that regardless of whether they started with the template or not, they are free to completely change the contents so that it wouldn't resemble the template in the end. So even if you could determine that, it doesn't seem worth anything.

  • Font problem creating WORD document with Oracle Reports 8i/9i

    I created a report using different Arial fonts. Once the report is generated from a .NET application, the fonts in the word document are changed apparently into Helvetica. This disarrange my lay-out completely. How can I solve this problem?
    (NB. when I generate a PDF, there is no problem!)

    By the way. I create the files in this way:
       private void createFile(String outFileName) {
          try {
             ByteArrayInputStream result = clientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
             File newFile = new File(outFileName);
             FileOutputStream output = new FileOutputStream(newFile);
             int bytesRead = 0;
             byte[] byteArray = new byte[10000];
             while ((bytesRead = result.read(byteArray)) != -1) {
                output.write(byteArray, 0, bytesRead);
             output.flush();
             output.close();
          } catch (Exception e) {
             e.printStackTrace();

  • Create Word document in Java application

    Hi all,
    Has anybody already used this Java Bean word processing in a Java application: http://www.must.de/default.html?Javactpe.htm ?
    Is it reliable ?? Any comments are welcome.
    What are the other ways to read/write a Word document in a Java application ?
    Thanks,
    Christophe

    Hi Naga,
    I have a problem using this word processing bean. The API can't find the template SampleTemplate. I have put this template and the API in the same folder, but I get a "Template SampleTemplate not found" when the wordAPI executes.
    Can you help ?
    Christophe

  • Generating reports in .doc format (Word Document) using Java POI - HWPF

    Hi
    Can anybody help me how to generate the report in .doc format using POI API?
    Please share the sample code, if you have.
    Thanks in Advance
    Dhilip

    Hi,
    I dont think that your requirement has to do with ADF capabilities.
    You want to edit a word document with JAVA. For that reason, you will need an API, as the suggestions above.
    You can do it without ADF and by using standard JAVA and the API of your choice. a static void main will do for that matter.
    ADF comes into the game when you want to handle the document with your ADF application.
    This means that you either want to get your new data to be placed on your doc from BC or any other DataControl or you want to do something else with ADF..
    My guess is that you want to get data from ADF into your Doc.
    You could create an API on handling your Doc and then use it into your ADF application.
    Regards,
    Dimitris.

  • Create a word document with TOC, table,etc

    Hi,
    How to create a word document with Table of content(TOC),header, footer, table, etc?
    Help me with any APIs or examples. I have already tried with POI API, but couldnt create TOC.. So any other api or any solution is available to create complex word document.
    Thank you

    Hi BIJ001,
    Thanks for your valuable suggestion.
    Open standards WordprocessingML format is supports by Microsoft word. It is typical xml format of designing word document. But creating document with TOC,tables, different styles of paragraphs are complex. Using this format, i have created simple docs. I never tried with complex formats like TOC. The generating File should be in ".doc or .docx" format only.
    Hi gimbal2,
    I am parallely looking to find solution in OpenOffice format also. But i never try out ".docx" file format. I will try to look out this option.
    Thanks for the input.
    Edited by: user13735134 on May 24, 2011 6:55 AM

  • Reading and displaying Ms.Word document with web dynpro java

    Hi,
    I'm using NetWever developer studio 7..0.21.
    I'm developing web dynpro java application.I'm in difficulty to read and display word document with its original format in web dynpro view. Is it possible?
    If possible , is there a blog etc.?
    Thanks.

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers.

    I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers. Any ideas?

    version 10.6.8

  • How To Create MS-Word Document in JAVA ?

    I want to create a MS-Word Document using JAVA.
    then i want to create table in that document.
    is there any way through which i can create a Object of MS-Word in JAVA.

    As far as I know. There is no support. And you can't get the file format specification for MS Word documents.
    My advice is to look in to RTF, the spec is out there, although its not very nice.
    I think you can do tables in RTF, and you just need to write your output as text and MS word will load it.
    One thing to do is create a table in Word and save it as RTF, then look at the text and try to see whats going on. Although it won't be pretty !! Good luck

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

  • Problem in printing pdf document with java code

    Hi All
    I want to print a pdf document with java code i have used PDFRenderer.jar to compile my code.
    Code:
    File f = new File("C:/Documents and Settings/123/Desktop/1241422767.pdf");
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel();
    ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
    PDFFile pdfFile = new PDFFile(bb); // Create PDF Print Page
    PDFPrintPage pages = new PDFPrintPage(pdfFile);
    // Create Print Job
    PrinterJob pjob = PrinterJob.getPrinterJob();
    PageFormat pf = PrinterJob.getPrinterJob().defaultPage();
    pjob.setJobName(f.getName());
    Book book = new Book();
    book.append(pages, pf, pdfFile.getNumPages());
    pjob.setPageable(book);
    // System.out.println(pjob.getPrintService());
    // Send print job to default printer
    pjob.print();
    but when i am running my program i am getting error
    Exception in thread "main" java.awt.print.PrinterException: Invalid name of PrintService.
    Please anybody, knows the solution for this error?
    Thanks In Advance
    Indira

    It seems that either there is no default printer setup or you have too many printers or no printer setup at all. Try running the following code. It should print the list of available print services.
    import java.awt.print.*;
    import javax.print.*;
    public class PrintServiceNames{
         public static void main(String args[]) throws Exception {
              PrintService[] printServices = PrinterJob.lookupPrintServices();
              int i;
              for (i = 0; i < printServices.length; i++) {
                   System.out.println("P: " + printServices);
    }From the list pick one of the print service names and set it explicitly like "printerJob.setPrintService(printServices);" and then try running the program.

  • Word document with multiple sections generates multiple pdf?

    Hello everyone,
    I'm a new and happy Mac user, but not fully able to use this. I hope you can help.
    I have a Word document, with multiple sections that I want to convert into pdf. When I used to do this with the PC, I didn't have problems. I used to use Click to Convert and I normally used to get one single pdf file.
    Now, using the pdf button wit the Mac, I get separate pdf files, one for each section. Is there a way that I can create a single pdf, with all the sections in order? If not, how can I merge the pdf in one single pdf file?
    Thanks in advance.

    Hi,
    just to let you know I have sorted this.
    http://macintoshhowto.com/leopard/how-to-merge-pdf-files-with-preview-in-leopard .html
    Thanks.

Maybe you are looking for