View Single Post
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

You have to use a macro but there is no standard way to recognise the
parameters, so you have to invent your own. Unfortunately the COMMAND
command isn't recognised in Office VBA so you have to use Win32 calls - for
some sample code, go to google groups and search for, e.g.

get microsoft word command line will rickards

Peter Jamieson

"Monika Krug" wrote in message
...
Hello,

I am looking for a command line parameter to specify the
data source for a mail merge document.

I start Word like this:
"C:\Program Files\Microsoft Office\Office11
\Winword.exe" "C:\My Documents\MailMergeMainDocument.doc"
Is there a switch that would tell Word which data source
to connect to?

Or if there is not, maybe it works with a macro?
"C:\Program Files\Microsoft Office\Office11
\Winword.exe" "C:\My
Documents\MailMergeMainDocument.doc" /mMacroThatConnectsDoc
umentToDataSource
Is there a way to specify parameters for a macro on the
command line?
... /mMacroName(param1, param2) or ... /mMacroName -
param1 -param2 maybe?
If this works, how can one get/use these parameters in the
macro?

Any help would be greatly appreciated,
Monika.