Run Word Template from DOS

J

JD Robbie

I want to run and existing Word Template from DOS

Sequence of events in existing template
1) logs into database
2) read data and formats into tables
3) creates document index
4) Save As "word document"

What would the DOS command be to do this ?


Any help would be appreciated.

Thanks,
John
 
H

Helmut Weber

Hi John,
just one of so many ways:
c:\prg\office10\winword.exe "c:\templates\mytemplate.dot"
It is assumed, that there is an autoopen macro in
mytemplate.dot, which takes over control and performs
all the following actions.
To prevent all the automation from executing every time
mytemplate.dot is opened, you may add something like
Dim Result As Integer
Result = MsgBox("continue", vbYesNo)
If Result = vbNo Then Exit Sub
at the beginning of autoopen.
 

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