Open dot file and run macro

N

Nalathni

Is it possible to open Word with a dot file (command line switch /t)
AND run a macro (command line switch /m) that's stored inside of the
dot file with parameters?

What I want to do is telling Word to change some content of the dot
file depending on a parameter I specify. Writing such a vb-macro is no
problem, but I have problems calling the macro from the command line.

Any ideas? Thank you!

Jens
 
P

Peter Hewett

Hi Nalathni

The answer is yes, but it's somewhat tricky. basically you need to retrieve the command
line and then manually parse out the command line contents to locate the parameters and/or
their values.

You'll need to use Windows API calls to get the command line. VBA has a Command$
function, but Microsoft in their wisdom decided that within any Office application this
would always return a null string!!!

HTH + Cheers - Peter


(e-mail address removed) (Nalathni), said:
 
N

Nalathni

The answer is yes, but it's somewhat tricky.

Thanks, I'll give that a try. But I noticed that it might be easier to
use DDE instead.

Jens
 

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