AutoNew macro doesn't run

G

Guest

I am using the Shell command in another application to run Word 2003 and open
a new document based on a template with the following command line:

"C:\Program Files\Microsoft Office\OFFICE\WINWORD.EXE" /t"c:\MyTemplate.dot"

Hint: you can test this by using the Start Run command or creating a shortcut.

The template contains an AutoNew macro, but it does not run when the
template is open via the command line. It runs perfectly when the template
is open in the normal way from Word. I have tried a ThisDocument
Document_New event procedure with the same result.

I have Macro Security set to Medium, and am prompted to enable macros, but
still the Auto or Event macros don't run
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UExDYXJy?=,

For a quick response, programming questions should be asked in one of the
word.vba newsgroups. This is an end-user newsgroup.

The problem you're running into is by design, I'm afraid. You'd need to automate
the Word application and use the Documents.Open method.
I am using the Shell command in another application to run Word 2003 and open
a new document based on a template with the following command line:

"C:\Program Files\Microsoft Office\OFFICE\WINWORD.EXE" /t"c:\MyTemplate.dot"

Hint: you can test this by using the Start Run command or creating a shortcut.

The template contains an AutoNew macro, but it does not run when the
template is open via the command line. It runs perfectly when the template
is open in the normal way from Word. I have tried a ThisDocument
Document_New event procedure with the same result.

I have Macro Security set to Medium, and am prompted to enable macros, but
still the Auto or Event macros don't run

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top