Question

As part of our build process (java build with ant), I want to update a version number somehow in or near a Word document (software guide). "near" meaning I'd accept updating the document properties rather than something in the text itself.

From looking around the internets, it looks like the main option is writing a small C# program that uses Office's COM functionality to do this task. I have a big philosophical problem with this (not the C# part, but making Office and COM part of our build process). Are there any other options out there?

(Yes, .docx is theoretically XML; haven't found anybody updating it that way yet - why not?)

Was it helpful?

Solution

Version 3.5 of Apache POI (a Java API for accessing Office format files) has support for Office Open XML format documents. It is currently in beta as of writing.

The Aspose.Words class library looks like a non-free option that could also be used to help solve your problem.

OTHER TIPS

You could have a look at how Groovy does it using using their Scriptom module which is based on the Jacob library (Java COM Bridge).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top