Java: parsing ms-word document using POI/HWPF
-
I have a ms-word document (MS-Office 2003; non-xml). Within this document there is a string associated with a bookmark. Furthermore, the word document contains word-macros. My goal is to read the document with java, replace the string associated with the bookmark, and save the document back to word format. My first approach was using Apache POI HWPF: HWPFDocument doc = new HWPFDocument(new FileInputStream("Test.doc")); doc.write(new FileOutputStream("Test_generated.doc")); The problem with this solution is that the generated file does not contain the macro anymore (File size of the original document: 32k; file size of the generated document 19k). Does anybody now if it's possible to retain all the original info using POI/HWPF?
-
Answer:
never found a solution. The customer had to pay an Aspose-license (expensive) or refrain from using macros.
user136200 at Stack Overflow Visit the source
Related Q & A:
- How do I open this word document in html?Best solution by Stack Overflow
- Is there a way of creating a interactive word document?Best solution by pcworld.com
- How do I attach a word document to an email?Best solution by Yahoo! Answers
- How do I solve the problem of downloading word document attached to my email?Best solution by support.google.com
- How to recover corrupted word document?Best solution by techrepublic.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.