Thanks antonieraj :)
Main Topics
Browse All TopicsI will be receiving an email on a regular basis that will contain well over 100 PDF attachments. I need code that can be run through Outlook 2000 that will acheive this task. I posted this question in the Outlook area and received what may be a good start:
Sub printPDFAttachment()
Dim olApp As Outlook.Application
Dim it As Object
Dim att As Outlook.Attachment
Dim intPos As Integer
Dim strExt As String
Dim wshShell As Object
Dim cmdLine As String
Dim strRun As String
Dim sel As Outlook.Selection
Dim myTempFolder As String
Dim acrobatPrint As String
acrobatPrint = "Acrord32.exe /p /h "
myTempFolder = "c:\temp"
Set olApp = Application ' CreateObject("Outlook.appl
Set sel = olApp.ActiveExplorer.Selec
For Each it In sel
If it.Class = olMail Then
For Each att In it.Attachments
intPos = InStrRev(att.FileName, ".")
strExt = LCase(Mid(att.FileName, intPos + 1))
If strExt = "pdf" Then
att.SaveAsFile myTempFolder & "\" & att.DisplayName
Set wshShell = Application.CreateObject("
cmdLine = acrobatPrint & myTempFolder & "\" & att.DisplayName
strRun = wshShell.Run(cmdLine, 1, True)
'wshShell.Quit (Commented Out...Said method does not exist)
Set wshShell = Nothing
End If
Next
End If
Next
Set sel = Nothing
Set olApp = Nothing
End Sub
The problem with this method is that I have to "X" down the Adobe application for each PDF found in the attachement. The person who gave me this code said that it worked great with Distiller but my expertise is in Excel, not Acrobat so I don't have a clue as to what distiller even is. I need a solution that can use a legal free copy Acrobat reader, unless distiller can legally be downloaded for free .
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi Shager
Another Method to print the files Automaticallly with free copy Acrobat reader..........
'This method prints the PDF c:\temp\filetoprint.pdf
Option Explicit ' Force variable declaration
' of an organisation
Sub PrintAPDFUsingTheFreeAcrob
Dim strCommandLine As String
Dim strPrinterName As String
Dim strDriverName As String
Dim strPortName As String
Dim strFileNameToPrint As String
strFileNameToPrint = "c:\temp\filetoprint.pdf"
strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port
' Perform some error checking here
strCommandLine = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe /t """ + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """"
If (Shell(strCommandLine, vbHide) <> 0)Then
MsgBox "Job has been sent to the printer using the command " + strCommandLine
End If
End Sub
Thanx
Antony.G
Antony,
I would rather go this route....but have a couple of questions.....
First, is this code for Outlook VBA ?
I am getting an "Object Required" error on this line ....... strPrinterName = Printer.DeviceName
Second,
Will this code close the Acrobat session ? I really want to be able to loop through all the PDFs attachments in my email. I can build the loop but I do not know how to close Acrobat in between each attachement nor do I know what switches may be required if I want to go with the same Acrobat session but loop throught the list.
Business Accounts
Answer for Membership
by: antonierajPosted on 2003-06-11 at 03:37:07ID: 8698152
Hi Shager
ainpage.as p?WebPageI D=392
pls. check the site. U can get the details of Batch print with "free copy Acrobat reader" !!
http://www.planetpdf.com/m
Antony.G