Il giorno Thu, 01 Jan 2009 09:29:48 -0500, Tcs <someone@xxxxxx> ha scritto:
>Is there a way that I can automate the printing of a document to my
>printers?
>
>I have a document, that I want to send to each of our printers. Can I
>do this via vbscript? There are several ways to print a document, depending on the application. You can ask
MsWord to do it for you if it is a doc.
This prints all files in a folder just like selecting the print verb from the context menu
(right click on the file). You should select the pdf printer as the default printer first.
TargetFolder = "C:\documenti\temp"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set colItems = objFolder.Items
For Each objItem in colItems
objItem.InvokeVerbEx("Print")
Next
I think you can set the default printer with WMI scripts. I haven't any, but you can
download scriptomatic from ms site to generate one for your purposes.
--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--