"Agostino Sclauzero" <(E-Mail Removed)> wrote in message
news:3441764A-5AF3-4A3A-AB57-(E-Mail Removed)...
>A customer creates a lot of pdf documents via his accounting software.
> All pdf files go into a folder, i want to create a simple batch that sends
> to a specific printer) all of them.
>
> If i create an .lnk to the printer and i copy the file onto it via shell
> it works just fine.
> Is there a way to script this?
>
> thanks in advance
> Agostino
I'm not aware of any command line switches for Acrobat that
would let you do this. You could use the macro written in VB
Script - see below. Instructions are at the start of the code.
To avoid the perennial problem caused by lines getting broken
up by your newsreader, use this link to get an intact copy of
the code below:
http://www.hotlinkfiles.com/files/12...intacrobat.vbs
'-------------------------------------------------------
'Print all Acrobat files located in the specified folder
'
'Save this file as c:\Windows\PrintAcrobat.vbs, then
'create this shortcut on the desktop:
'cscript.exe //nologo c:\Windows\PrintAcrobat.vbs
'
'Remember to adjust the values for "FolderName" and
'"Acrobat" to suit your own environment.
'
'Note that this program, like all macros, is not robust.
'It can easily fail due to unexpected events such as a
'virus scanner pop-up.
'
'15.4.2008 FNL
'-------------------------------------------------------
Const Acrobat = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
Const FolderName = "d:\temp"
Const delay = 5
Set objWS = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(FolderName)
For Each objFile In objFolder.Files
If Right(UCase(objFile.name), 4) = ".PDF" Then
objWS.Exec Acrobat & " " & FolderName & "\" & objFile.Name
WScript.Sleep(1000 * delay)
objWS.SendKeys "%FP{Enter}"
WScript.Sleep(1000 * delay)
objWS.SendKeys "{Enter}"
WScript.Sleep(2000 * delay)
objWS.SendKeys "%FX"
End If
Next