Re: Search for File/Directory

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


"y770" wrote:

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.


"Danny J. Lesandrini" wrote:

Use Application.FollowHyperlink strFileName instead of Shell

--
Danny J. Lesandrini
dlesandrini@xxxxxxxxxxx
www.amazecreations.com


"y770" <y770@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote ...
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.



.



Relevant Pages

  • Re: Worddokument aus Access Qffnen?=
    ... von FollowHyperlink bin ich komplett weg, da ich mit dieser Art des ... Aufrufes von PDF-Dateien und Acrobat 7.0 Probleme hatte. ... ShellExecute hat es wieder richtig funktioniert. ... Gruß Ahmed ...
    (microsoft.public.de.access)
  • Re: How to Open Single Instance of Program
    ... put a /one switch in the windows file association for jpg/Irfanview then ... >> time it runs it opens a new instance of IrfanView. ... >> 'First try ShellExecute ...
    (microsoft.public.office.developer.vba)
  • Re: Open Browser Maximized
    ... ByVal lpOperation As String, _ ... ShellExecute 0, "open", strURL, vbNullString, vbNullString, 3 ... except I would like the browser window to open maximized. ... Currently the browser opens in the previous windows state. ...
    (microsoft.public.excel.programming)
  • Re: Application.HyperLink vs controlname.HyperlinkAddress
    ... Where hyperlinks or file paths to be opened are data -- as opposed to static links on forms, as for example links to help pages -- I don't use hyperlink addresses or hyperlink fields as such. ... I store the URL in a text field and either use Application.FollowHyperlink or fHandleFile (the Windows ShellExecute API) to open the URL as appropriate. ... The reason I don't use the Hyperlink field type is that editing it becomes complicated, since what you usually see is the display text, not the actual hyperlink address. ... My natural inclination would be to use FollowHyperlink for an http: URL, and ShellExecute to open a file with the registered application. ...
    (microsoft.public.access.formscoding)
  • RE: msi step fails only if run via bootstrapper
    ... "ShellExecute" API to open an rft file. ... it brings up Word and opens filename.rtf for ... I suggest you may try this exe file on other machines. ...
    (microsoft.public.vsnet.enterprise.tools)