user935143 user935143 - 1 year ago 110
Java Question

run word macros without open word window

i'm trying to execute msword macro from Java code using this:

Runtime rt = Runtime.getRuntime();
Process process = rt.exec("WINWORD.EXE <macroname> /w /m");

when this command executed the word open and close.
is there a way to run word macros in background without opening the msword window and close?

Answer Source

I doubt that what you are asking is possible because you are sending a direct command to Process.

One way I would overcome this, is to create a VBS file one the file systems (in this file I would create the MSWORD object, hide it and then send the macro command ).

And then run the vbs file using java

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download