Page 1 of 1

execute macros with docx4j

PostPosted: Fri Jan 14, 2011 7:16 pm
by Lars
Hello,

I've got a document with marcos in the document_open section. The problem is that I want to merge this document with another after the macros were executed and without opening the document with word 2007.

Is there a possibility to "execute" the marcos from the outside with docx4j?

kind regards
Lars

Re: execute macros with docx4j

PostPosted: Sun Jan 16, 2011 8:17 pm
by jason
In a word, "no".

Assuming you could read the macro, to interpret it you'd need a basic language interpreter. Although there are several of these implemented in Java, the interpreter would also need to implement the Word object model, as exposed to VBA.

An alternative might be to try Go-oo; see http://www.linuxforu.com/how-to/vba-mac ... ffice-org/ If you are lucky and it runs your VBA, you can save as docx (if you use an appropriate build of go-oo).

Please let us know your experiences.