I am trying to create a new document by calling a Word template, which has a macro, in a command line.
The actual command line is something like this:
However, due to a Microsoft Word problem, it doesn't work at all...That sucks! It seems MS decided not to fix it...
In MS web site, it posts a work around at
The problem is...The sample code inside this article doesn't work either. Here is the sample code :
' Create a new document based on your custom template.
' Close your custom template.
MsgBox "Other code goes here."
Whenever I ran it, it posts a "type mismatch" error at the first line. Here is what I did in creating the template and macro :
1. Create a new template in MS Word
2. Go to Tools->macro->macros and choose the new template
I just created and create a macro called MyMacro in it.
3. Paste in the above code and save it.
Any Idea why it doesn't work or any other
work around for this MS word bug? Is there anything I did wrong in creating the macro? Thanks a lot.