Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Word VB macro with run-time argument

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JD Robbie - 05 Nov 2004 17:29 GMT
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
Howard Kaikow - 05 Nov 2004 21:45 GMT
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.

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> I have a Word VB macro that retrieves data from a database.
>
[quoted text clipped - 23 lines]
> John
> Toronto, Canada
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.