Opening PDF from access

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
 
G

Guest

You don't need to use shell. Simply use

Application.FollowHyperlink "YourPathToTheFile"

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top