'VBA print pdf files via folder picker

Would like to inquire if you have a VBA code or macro that could print pdf files in a certain folder (folder picker). Your response is highly appreciated.

Here’s the code:

Sub PrintPDF()

Dim MyFiles As String
Dim GetPath As String

    With Application.FileDialog(msoFileDialogFolderPicker)

    If .Show <> 0 Then
             GetPath = .SelectedItems(1)
    End If

Do While MyFiles <> “”

MsgBox (GetPath)
Worksheets(“Sheet1”).Cells(3, 3).Value = GetPath
ActiveWorkbook.Sheets(“Sheet1”.PrintOut Copies:=1
ActiveWorkbook.Close SaveChanges:=False

Shell “C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe /p /h “ & Chr(34) & sPDFfile & Chr(34), vbNormalFocus

MyFiles = Dir
Loop

End With

End Sub


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source