AutoNew deos not run with winword.exe

T

Titus Kruse

Hi!

I got a template with an AutoNew() Macro. When I open Word and select "New
Document" with this template, the AutoNew()-macro is called. But when I run
Word from DOS the macro isn't called. Why that? I'm using Word 2000. In Word
2003 I got the same problem.

Titus Kruse
 
D

Doug Robbins - Word MVP

An autonew macro only runs when a new document is created from the template
in which it is located. If you want a macro to run when word is started, it
should be named autoexec()

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Titus Kruse

Hi Doug!

I want to create a document from my template! My wish is to run Word from
the command shell with a previously created template. A macro in this
template should read data from a given .ini-file and merge this data with
fields in the new document. Because /t and /m couldn't be used together, I've
placed an AutoNew-Macro in my template.
 
G

gils usenet acct

Thanks !
Useful info. :)
Gil

Doug Robbins - Word MVP said:
An autonew macro only runs when a new document is created from the
template in which it is located. If you want a macro to run when word is
started, it should be named autoexec()

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Titus Kruse

Useful info? Yes. But the reply doesn't address the issue of my question. I
don't want to run a macro every time Word starts. And anywhere, even
AutoExec() doesn't run when the template has been called via shell command
winword.exe and the /t option.

Greetings, Titus
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?VGl0dXMgS3J1c2U=?=,
I want to create a document from my template! My wish is to run Word from
the command shell with a previously created template. A macro in this
template should read data from a given .ini-file and merge this data with
fields in the new document. Because /t and /m couldn't be used together, I've
placed an AutoNew-Macro in my template.
Word isn't designed to function like this; you can use the web interface to make
a "Suggestion" to Microsoft that you'd like to be able to invoke a macro in a
template when creating a new document from the command line.

/t will not execute AutoNew
/m must be in the Normal.dot template

If you were automating Word's object model, then the AutoNew would execute.

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