PC Review


Reply
Thread Tools Rate Thread

Batch file Open Word, run macro

 
 
New Member
Join Date: Jun 2012
Posts: 1
 
      22nd Jun 2012
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: run batch job from each row - how to insert run batch function per JLatham Microsoft Excel Misc 0 26th Feb 2009 08:16 AM
RE: run batch job from each row - how to insert run batch function per JLatham Microsoft Excel Misc 1 19th Feb 2009 06:44 PM
RE: run batch job from each row - how to insert run batch function per JLatham Microsoft Excel Misc 0 18th Feb 2009 05:30 PM
batch file call from a macro - how ? and required batch format VB-rookie Microsoft Excel Programming 3 5th Sep 2008 10:33 PM
Calling Batch within a Batch File ChuckR Microsoft Windows 2000 Developer 0 22nd Apr 2004 02:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:38 AM.