PDA

View Full Version : Solved: Shell command to open pdf file in Acrobat 8.0



Davedavedave
02-25-2010, 07:23 AM
I have been using the following to open pdf files in Acrobat 7.0:

Shell ("C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe " + "/A ""page=1"" " + "H:\My Office\Test Folder\PdfTest.pdf")

Some of my colleagues have been updated to Acrobat 8.0 and the same command does not seem to work:
Shell ("C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe " + "/A ""page=1"" " + "H:\My Office\Test Folder\PdfTest.pdf")

Acrobat will open up but it says the file cannot be found. The macro searches to make sure the file is there before it gets to this command so it is as if Acrobat 8 is just not recognising the path. Am I missing something simple here? Can anybody help please?

Thanks
Dave

lucas
02-25-2010, 08:26 AM
Follow hyperlink works for me with Acrobat 8:

Option Explicit
Sub OpenPDFdoc()
MsgBox "This will fail if you don't have Adobe Acrobat installed :o)"
On Error GoTo 1
' ActiveWorkbook.FollowHyperlink ActiveWorkbook.Path & _
' "\Letter.pdf", NewWindow:=True
ActiveWorkbook.FollowHyperlink "C:\Temp\Letter.pdf", NewWindow:=True
Exit Sub
1: MsgBox Err.Description
End Sub

Davedavedave
02-25-2010, 09:56 AM
Thanks for that, that's much simpler!

lucas
02-25-2010, 10:04 AM
Dave, if that solves your problem, please mark your thread solved using the thread tools at the top of the page.

That saves time for those offering help by allowing them to avoid reading entire threads just to find it has been solved.

Welcome to the board.