Word VB macro with run-time argument

J

JD Robbie

I have a Word VB macro that retrieves data from a database.

I would like to enhance it to have run-time options or parameters /
arguments that will cause the macro to retrieve different data and different
save as name, for example.

example:
I am running from DOS
"C:\Program Files\Microsoft Office\OFFICE11\winword.exe" /w
/mCreateRegularCatalogue

but it would be nice to add an argument or option for "christmas product" like
"C:\Program Files\Microsoft Office\OFFICE11\winword.exe" /w
/mCreateRegularCatalogue /"xmas"

or
"C:\Program Files\Microsoft Office\OFFICE11\winword.exe" /w
/mCreateRegularCatalogue /"complete"


Is there a way / is this possible ???

I don't want to create extra macros, just one macro to handle all options.
Any ideas ?

Thanks,
John
Toronto, Canada
 
H

Howard Kaikow

Macros are by definition Public subs that have no arguments.

I've never tried, so I do not know whether it can be done, perhaps, it is
possible for the macro to parse the command line.
 

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