returncode=msgbox ("put some paper in the printer",65,"Print start")
if returncode=1 then
Set ss = CreateObject("WScript.Shell")
ss.run "command /c notepad /p c:\rjm\test.rpt ",1,TRUE
msgbox "Print is finished",64,"Print finished"
end if
I still have one issue. The script executes but still asks for the output file name when printing. Since the printer is 'print to a file', cna I send the file path and name to the printer for no user intervention.
I have never been able to script the windows printer dialog box with any luck which is what you need to do here to pre-populate those parameters. I have been trying to write a script to turn on and turn off duplexing from a shortcut with no luck. If I run accross something I will let ya know.
But the question is never well-posed. I don't think blanket statement like send a file to printer make any concete meaning unless you say what kind of file.
If it is a text file or msword doc file, you can use word.application using its printout method with the parameter printtofile specifying the file name.
If it is xls file, the same kind of method exists and again the file name can be specified. And no popup asking for filename will ever happen.
In any case, too general a question will lose any useful meaning. Maybe "use" is not a question.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.