Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How to edit a Microsoft Word document in Java?

Hello Friends,

I have a java program that generates text in 6 columns. I have a word document that is basically a template with a 6 column table. I was wondering if there is any way to take the text generated in my eclipse program and have it be printed in the 6 columns in word. If anybody knows how to do this, I would really appreciate your help.

Thanks so much.

2 Answers

Relevance
  • Ben
    Lv 7
    8 years ago

    Use this library: http://poi.apache.org/

    I have no idea how complete it is or how well supported it is, but it's generally not easy to interact with Word documents. The simplicity of the Word (and OpenOffice) interfaces hide how complex the file formats actually are under the hood.

  • 8 years ago

    Don't update the document, update a table. If you Google "Automating Word Tables for Data Insertion" you'll find info and examples on Microsoft's site.

Still have questions? Get your answers by asking now.