PDA

View Full Version : Defining Variable from Command Line



thesoxman
03-05-2006, 03:09 AM
Hi,

I've been asked to automate the execution of a particular Word macro that generates our catalogue every month. This macro basically takes in 2 varibles from a userform and creates the catalogue from our database based upon these inputs. What I am hoping to do is find a way to pass these variables into the program via the command line/script so that I can automatically schedule this process at a desired time and output the catalogue to a specified location.

Any help with this would be much appreciated!

mdmackillop
03-05-2006, 06:15 AM
Hi SoxMan
Welcome to VBAX.
Where is your command line being run from? A userform in Word?
Regards
MD

TonyJollans
03-05-2006, 07:57 AM
I don't know the answer, but what scripting language are you using? It may be possible to automate Word from VBScript.

Another option which will be possible is to put the parameters in a text file which the Word macro can read - and that could be created within your script.

fumei
03-06-2006, 11:04 PM
You can not pass parameters directly into a Word macro from the command line.

You can action Word directly with VBScript, but I do not think you can script parameters into an existing Word macro with VBScript.

You can, as Tony suggested, have those parameters in a text file that a Word macro can read, then use.

The issue then is writing that text file. Which you could do with VBScript.