Opening PDF from access

  • Thread starter Thread starter H. Martins
  • Start date Start date
H

H. Martins

Hi.

If we do ...

strAppName = "C:\Program Files\Adobe\Reader 8.0\Reader\acrord32.exe c:
\data\xpto.pdf"
Call Shell(strAppName, vbNormalFocus)

.... acrobat starts and displays the file. Perfect.

The problem is that for one side calling Acrobat itself needs full
path, for the other, Acrobat location directory changes a little from
computer to computer. Still, the full Acrobat executable path seems to
be mandatory.

If we do Start->Run c:\data\xpto.pdf, the operating system starts
Acrobat and displays the file, but the same does not happen if we do
the same from within Access, something like ...

strAppName = "c:\data\xpto.pdf"
Call Shell(strAppName, vbNormalFocus)

... Acrobat does not start.

Is there a way to pass to the operating system the instruction to open
the PDF file just as Start->Run c:\data\xpto.pdf ?

Thanks for help,
H. Martins
 
You don't need to use shell. Simply use

Application.FollowHyperlink "YourPathToTheFile"

Application.FollowHyperlink "c:\data\xpto.pdf"
 
Back
Top