May 14, 2009 - HWPFDocument doc=new HWPFDocument(finStream);// throws IOException and need to import org.apache.poi.hwpf.HWPFDocument. To import an application client JAR file using the wizard, complete the following steps: In the Java™ EE perspective, click. Under Select an import source, click. In the Application Client file field, enter the location and name of the application client JAR file that you want to import.
I want to load a template word document to add content to and save as new document. I'm working on .doc file.
After a long research I only found solutions for docx :
So I want to replace any variable written in this format:
$VAR
by its value. Can I do it with velocity or Apache-poi, what is the best solution for it.Any help will be appreciated.AmiraAmira
2 Answers
Yes, you can do it using Apache-POI. Your variable names must be unique. See the following code
LiquidpieLiquidpie
Vikrant,
The code Snippet is given above and in order to work, we need jar mentioned above. Along with that Jar, use/download poi-3.5-FINAL.jar as well.
Hope this will answer your question.
SandeepMandaSandeepManda
protected by Community♦Aug 11 '17 at 18:13
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?