Print a series of pdf files with vba excel

claudiusgenius Posted messages 2 Status Member -  
claudiusgenius Posted messages 2 Status Member -
Good evening,

I am looking to print all the PDF files in a directory. I thought of opening acrobat reader and starting the print, but I’m having issues. Is there a kind soul who could lend me a hand? The application opens but the file doesn't????

Sub searchfile()
Dim FileName As String
Dim Folder As String

Folder = "My documents\"
Path = "C:\Documents and Settings\Administrator\" & Folder
filePath = "c:/Documents and Settings/Administrator/" & Left(Folder, Len(Folder) - 1) & "/"
Count = 0
FileName = Dir(Path & "*.pdf")
While FileName <> ""
file = filePath & FileName
MyAppID = Shell("C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe & file & ".pdf"", 1)
Debug.Print AddItem; FileName
FileName = Dir
Count = Count + 1
Wend
Debug.Print Count & " files"
If Count = 0 Then
Debug.Print "No file in the folder"
End If

End Sub

2 answers