Automatically updating a keyword in a Word document

As part of our build process (building java using ant), I want to somehow update the version number in or next to a Word document (software manual). "near" means that I agree to update the properties of the document, and not something in the text itself.

Looking back on the Internet, it seems like the main option is to create a small C # program that uses Office COM features to accomplish this task. I have a big philosophical problem with this (not with the C # part, but with Office and COM part of our build process). Are there any other options out there?

(Yes, .docx is theoretically XML until it has been discovered that someone is still updating it - why not?)

+3
source share
2 answers

Version 3.5 of Apache POI (Java API for accessing Office files) supports Office Open XML documents. It is currently in beta testing.

The Aspose.Words class library looks like a proprietary option that can also be used to solve your problem.

0
source

You could take a look at how Groovy uses it with the Scriptom module , which is based on the Jacob Library (Java COM Bridge) .

0
source

Source: https://habr.com/ru/post/1711929/


All Articles