I have the following code that opens a PDF and prints (as well as a cuople
of excel files). That part works perfectly, but how would I go about closing
the PDF after it prints?
Dim Folder As String
Dim FName As String
Dim bk As Workbook
Dim strPath As String
strPath = ThisWorkbook.Path
.SearchSubFolders = True
.LookIn = strPath
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) Like "*File 1*.xls" Then
ElseIf .FoundFiles(i) Like "*File 2*.xls" Then
ElseIf .FoundFiles(i) Like "*File 4*.pdf" Then
ActiveWorkbook.FollowHyperlink .FoundFiles(i), NewWindow:=True
Application.SendKeys "^p~", False
MsgBox "There were no files found."
thanks as ever!