Wasn't me, but I'm guessing you got downvoted because you haven't said what you've tried, what version of Word you're using, or what OS you're on. All of those things are useful in diagnosing the issue.
I'm also guessing that you can not simply save the macro to whatever document you want to run it in, because that should be trivial. Am I correct?
If so, I am trying to do something very similar using Word 2010 on Windows 7 64-bit, but I can't get it to work yet either. The document I need to open is auto-generated from pandoc and is opened in compatibility mode, so perhaps that's my issue. If that's not the case for you, some of the things I've tried might help you.
- Use the /t option from the command line:
start winword /tmacros.dotm document.docx
- If that doesn't work, try adding the /m option as well:
start winword /tmacros.dotm /mAutoOpen document.docx
.
- Instead of naming the macro
AutoOpen
, try AutoExec
or Document_Open
.
Note: there is no space between the /t or /m options and the filenames. I've also tried the full path to winword.exe instead of start winword
but that didn't make a difference.
Hope this helps, good luck! And please post the solution back here if you figure it out on your own.
Sources:
Command line switch: http://support.microsoft.com/kb/290961
AutoExec/AutoOpen: http://support.microsoft.com/kb/286310