View Single Post
 
Old 02-03-2013, 12:08 AM
jdockstader jdockstader is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Feb 2013
Posts: 4
jdockstader is on a distinguished road
Default From the command line, how do I run a Word macro?

As part of a workflow in a PDM system, I have to convert a Word file to PDF. I've written a macro that will save the PDFs and close Word. I can't put that macro in every users Normal.dotm file so I need to be able to load it from a shell command. I saved my macro, SaveAsPDF, in a Custom.dotm and I can put that in a shared location (during testing it's on my c: drive)

When I execute the command
"C:\Program Files (x86)\Microsoft Office\Office12\winword" /l"C:\Custom.dotm" /w %filename% /mSaveAsPDF
Word opens with the file and the macro is present but doesn't execute.

I've tried using /t instead of /l to load the macro containing template but it doesn't seem to work at all.
Reply With Quote