Start Word with Macro


#1

Hi, I am very new to Electron here and am looking for advice on how to open Word and fire up a Macro.

At this point I can open Word but do not know how to pass the command-line switch to open the macro.
The command-line switch for this is ‘/mTHENAMEOFTHEMACRO’

Currently I am using:
var cp = require(“child_process”);
cp.exec(“PATHTOTHEDOC”);

This opens the document I want to run the macro on.

How can I pass ‘/mTHENAMEOFTHEMACRO’ along with it?

Thanks!


#2

This isn’t really an Electron question but a Node question. The documentation for Node’s child_process.exec has an example of how to run something with parameters.


#3

Thanks leedohm, looks promising. Cheers!


#4

leedohm, just a follow up - Worked like a charm and now I ‘get it’.
Thank you!


#5

I’m glad to hear that things are working for you now :bow: