Updating values of custom properties in word doc using java -


I am not able to update the value of the custom property in a word document using Java.

I is a word document that has a custom property with value 'stack' using java. I want to convert that value to 'overflow' I used two methods

1) Use of Apache POI

I have set org.apache.poi.hpsf.CustomProperties in org.apache.poi.hpsf.DocumentSummaryInformation and written it on POIFSFileSystem.

It updates the price in the custom properties table of the word but does not update the value of that related asset in the document. After the document is opened, I manually update the document Need to refresh.

2) Paste the document with four characters and use the field code of DC3, DC4 and NAC to identify the location of the custom code. a quality. Replace existing value with new value.

The generated documentation now includes new values. But the problem here is that if the length of the old value and the new value are different then the document gets corrupted. I have ensured that the argument is quite good.

Any help would be appreciated.

To resolve this issue, I update this approach:

< P> Using the Office 2007 (docx) document becomes easier as a template. It is nothing but zip document, you can open it using your zip app (Winzip / 7zip) and you can find many XML files inside it. Document.xml contains content, styles.xml contains formatting information and so on.

At the runtime, I unzipped the document and parsed the document.xm, then used the dot and updated with dynamic content. Custom properties are available in a separate XML file.

For 2003 users, they must prepare a template using the word application and save the document as XML so that it can be provided as an input.

No longer use Apache-Poi.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -