Search for File/Directory

Y

y770

I need to launch pdf file in external Acrobat window. Using Call Shell
require exact path to the Acrobat Software. Here is my probem starts. The
application I am writing is used bay many people on the network. Some have
Acrobat 8, some 9, some Reader some Pro..., etc. How do I find a path to
appropriate software to open pdf file?
If there is a link that describes the solution or the hint to the solutuon,
it will be greatly appreciated.

Thanks for your help.
 
Y

y770

Thanks a lot!
I always thought of ".FollowHyperlink " as for opening web pages only.
To learn something new is never too late and never to early ;)

Thanks again.
 
D

dymondjack

I always thought of ".FollowHyperlink " as for opening web pages only.

A 'hyperlink' isn't only webpages, but can be a UNC filepath as well, which
covers almost every file or shortcut on the computer.

The only issue that I've found with .FollowHyperlink is that the OS opens it
as a hyperlink, which are handled with much much higher security due to this
wonderful age of spyware/adware/viruses, etc. At one point I tried using
FollowHyperlink at the recommendation of some fellow posters, and it worked
well - for the most part. There was one particular type of file (autodesk
..dwf) that I ran into that could not be opened like this. Under the
circumstances, I think that it had more to do with the security built into
the file rather than the OS, but I had also noticed that some paths required
verification from the users.

I can't imagine pdf files being problematic here (they worked fine with this
in my system, when I did use it), but I thought I would throw it out there
anyway.

For whatever reason (I don't remember why, really), I wound up using neither
the Shell function built into vba, or .FollowHyperlink, but instead the
ShellExecute API, which can be found here:

http://www.mvps.org/access/api/api0018.htm

Again, I don't know if I ever had problems with the regule Shell function,
but I am a faithful user of ShellExecute.

Regarding the path of the executable to open a pdf document, ShellExecute
should be able to open the file regardless of what version of acrobat (reader
6,7,8, standard, pro) is installed. ShellExecute *should* be reading the
registry for the associated executable for the filetype it is trying to open.
If there is no registered executable for that particular filetype, you
*should* get the "Open With" dialog. (AFAIK, this is the same thing
FollowHyperlink does, only at a 'system' level instead of 'user/hyperlink'
level).

That said, I don't know why the Shell function wouldn't do this... I was of
the impression it worked the same way (get the registered executable). In
any case, I am able to use ShellExecute with three different versions of
acrobat/reader on various client computers, without issue.

I'm not sure exactly how accurate all of this is, this type of stuff isn't
my strong point, but I figured I'd throw it out there from my own experience
with it. I think I've got the general jist of it down, any, if all my
details aren't quite where they should be.


--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 

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