The following code will open the PDF file. I have tried it and it worked for me .
Dim str As String ' this is the path to the file
str = "C:\" 'path to .pdf
Application.FollowHyperlink str & "Test.pdf"
To print a PDF file I found this in a google search:
This VBA code will print a PDF document whose fullpath is passed in as the argument. The "/P" command line option tells Acrobat to print. The user will only see the "select printer" dialog. There may be an Acrobat reader command-line option to print to the default printer so that the printer dialog box doesn't even open, but I don't know what it is.
Sub Print_PDF(sDocumentFullPath as string)
Dim sAcrobatReaderExe As String ' full path to the Acrobat reader executable
sAcrobatReaderExe = "C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"
RetVal = Shell(sAcrobatReaderExe & " /P " & Chr(34) & sDocumentFullPath & Chr(34), 0)
__________________ Bob Fitzpatrick Microsoft Community Contributor Award (2011) If this helped, please click the scales at the bottom left of this posting. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Many thanks.
I have never failed. I have found a thousand ways that do not work!
The Following User Says Thank You to bob fitz For This Useful Post: