Printing Office Documents from a 'BAT' file

M

Mark

Hello group,

Can anyone here point me to a resource that explains how
to print a series of office documents from a DOS 'BAT'
file. I have tried recording a macro and specifying that
macro and the file to print as command line argurments
with limited success. I would like the entire process to
take place in a background mode. That is, I do not want
to actually see the application come up, I just want it
to print the associated file and exit.

The BAT file I have tested with so far looks like this:
"c:\Program Files\Microsoft Office\Office10
\winword.exe" /mprintfileandclose "test1.doc"
"c:\Program Files\Microsoft Office\Office10
\winword.exe" /mprintfileandclose "test2.doc"
"c:\Program Files\Microsoft Office\Office10
\winword.exe" /mprintfileandclose "test3.doc"
"c:\Program Files\Microsoft Office\Office10
\winword.exe" /mprintfileandclose "test4.doc"
"c:\Program Files\Microsoft Office\Office10
\winword.exe" /mprintfileandclose "test5.doc"

I would be willing to pay for a delivered solution to
this problem.

Thank you for your interest and assistance.

Mark
 
S

Steve Culhane [MS]

Mark,
Instead of using a batch file, have you thought of writing a quick VB
applications that uses automation. You could open up an instance of Word,
have it be invisible, and open each of the files you want to print one at
a time. If you get the list of files from a directory, you can open them
one at a time, and print them. Now you only have to put the files in a
predetermined directory, and then run your app.



let me know if this helps.


Stephen Culhane
(e-mail address removed)
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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