Hi,
I am trying to create a batch file that will open Word and run a specific macro using the /m[macro] switch. The macro in Word does some stuff, saves the file, and closes Word.
This is what I have got so far:
for %%x in (*.doc) do start /wait "winword.exe" "%%x" /mMACRO1
When placed in the same dir as all the Word files I wish to edit, it will open the first file but MACRO1 will not run. If I close the window the next Word doc will open but again, the macro does not run.
I suspect it is something fairly simple I am missing.
Running the below from the Run window works flawlessly:
winword.exe "c:\path\file.docx" /mMACRO1
Any idea what I'm missing?
I am trying to create a batch file that will open Word and run a specific macro using the /m[macro] switch. The macro in Word does some stuff, saves the file, and closes Word.
This is what I have got so far:
for %%x in (*.doc) do start /wait "winword.exe" "%%x" /mMACRO1
When placed in the same dir as all the Word files I wish to edit, it will open the first file but MACRO1 will not run. If I close the window the next Word doc will open but again, the macro does not run.
I suspect it is something fairly simple I am missing.
Running the below from the Run window works flawlessly:
winword.exe "c:\path\file.docx" /mMACRO1
Any idea what I'm missing?