Opening a .pdf file with a special path

  • Thread starter Jean-Jérome Pillet
  • Start date
J

Jean-Jérome Pillet

Hello everybody,

I have a problem in my Access programm :
I want open a pdf file (helpfile) with the command shell ;

Shell ("C:\Appl\AcrobatReader6\Reader\ACRORD32.EXE U:\ACCESS -
OK\Utilisation du gestionnaire de licences.pdf"), vbNormalFocus

This command is Ok but a lot of people will use my application for several
years, and perhaps the version of Acrobat Reader will be the 7... so, the
path won't be ok and my helpfile.pdf will not be opened!

Somebody can explain me how to write this path? or give me another command?

Thank you very much for you help
 
D

DL

Try posting to a microsoft.public.access , or one of its subgroups for a
more informed response.
From recollection, you would need, within your coding block, to search for
the Acrord32.exe, then using variables build the path for your command.
As you've realised you shouldn't hard code a path, allthough you would have
to assume the name of the 'exe' will not change.
 
G

Gary Smith

If you want this to work on as many systems as possible, you'll get the
association for .pdf from the registry key HKEY_CLASSES_ROOT\.pdf, which
is probably something like "AcroExch.Document" on most systems, then use
that to get the value from
HKEY_CLASSES_ROOT\{What you found}\shell\Open\command. That will be the
command line skeleton to open the file. On my system, it's "D:\Program
Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" /t "%1" "%2" "%3" "%4"

Some of those parameters not not be necessary for your purposes. Doing it
this way will allow your application to work with different versions of
the Adobe Reader, verious versions of Acrobat, and probably even
alternative applications like Foxit PDF Reader.


Jean-J?rome Pillet said:
Hello everybody,
I have a problem in my Access programm :
I want open a pdf file (helpfile) with the command shell ;
Shell ("C:\Appl\AcrobatReader6\Reader\ACRORD32.EXE U:\ACCESS -
OK\Utilisation du gestionnaire de licences.pdf"), vbNormalFocus
This command is Ok but a lot of people will use my application for several
years, and perhaps the version of Acrobat Reader will be the 7... so, the
path won't be ok and my helpfile.pdf will not be opened!
 

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