automate printing

A

Agostino Sclauzero

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
 
P

Pegasus \(MVP\)

Agostino Sclauzero said:
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/1221034_v20tb/printacrobat.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
 
P

Pegasus \(MVP\)

Agostino Sclauzero said:
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

Sorry, wrong link. Use this one:
http://www.hotlinkfiles.com/files/1221643_bfqib/printacrobat.vbs
 

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