0

I'm working on a project for work that requires me to ask some informations to the user, then write them down in a Word document. The thing is that I have to write those informations in a document that already exists, containing tables, checkboxes and so on... I tried using Apache POI, which is useful when it comes to creating a Word document, but does not seem to help me filling an existing one. How should I proceed ? What API should I use ?

Thanks in advance for any help.

ArcDexx
  • 453
  • 5
  • 15
  • _which is useful when it comes to creating a Word document, but does not seem to help me filling an existing one_ [Updating an MSWord document with Apache POI](http://stackoverflow.com/questions/7431334/updating-an-msword-document-with-apache-poi) - question contains useful code. – BackSlash Jun 10 '14 at 14:34
  • See this discussion too: http://stackoverflow.com/questions/15737169/how-to-edit-existing-word-file-using-poi-api – AlexR Jun 10 '14 at 14:35
  • Thank you for those informations. – ArcDexx Jun 10 '14 at 14:41
  • If you only want a thing to change a document (eg generate a word from a template), have a look at [docxtemplater](https://github.com/edi9999/docxtemplater). It ships with a command line tool and there's a demo here: (http://javascript-ninja.fr/docxgenjs/examples/demo.html). I also wrote a blog post about why you should use this instead of Apache POI here: http://javascript-ninja.fr/why-docxtemplater-is-so-awesome-to-generate-docx-files/ – edi9999 Jun 10 '14 at 15:15
  • Thanks a lot edi9999 your library is exactly what I was looking for. – ArcDexx Jun 11 '14 at 07:07

1 Answers1

-1

What you could do as well in such a case is renaming the .docx file to .zip. Unzipping it, update the content xml (so filling it up with your values) and zip and rename it again.

P.E.K.K.A
  • 24
  • 1