Open file:// URL?

jimbrooking

Registered User.
Local time
Today, 12:16
Joined
Apr 28, 2001
Messages
210
I have an Access app that is distributed with an HTML file. The HTML file contains references to US gov't regulations for the privacy and security of medical records (HIPAA), including definitions of terms. The Access app contains a number of command buttons for the purpose of looking up the exact text of a section of the regulation, looking up definitions of terms, etc.

The code that opens the HTML file uses the ShellExecuteA entry to shell32.dll (hope I'm saying that correctly). The code works fine, so long as MSIE is the user's default browser. If the user's default browser is a good browser, e.g., Mozilla 1.5, or Mozilla-Firebird 0.7, clicking any of the command buttons will open the user's default browser (or send focus to an existing copy of the default browser), but it doesn't open the file:// URL passed to ShellExecuteA.

I have tried a number of ways of formatting the file:// URL, e.g., enclosing it in double-quotes, changing the "\"s to "/"s, changing the "\"s to "%5C"s, etc., etc., without success.

I have code (using the FindExecutableA entry to shell32.dll) through which I can find whether the user's browser is MSIE or "other".

Does anyone have an idea (or better, working code) that will reliably open whe user's favorite browser to view a file:// URL?

Thanks,
Jim
 
Use the FollowHyperlink method instead of the Shell command. The function below should open up this posting with a new browser using the users default.

Public Function Test()
Application.FollowHyperlink "http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=56590"
End Function

HTH
 
Thank you for the idea. This did open the link correctly. However, it opened the link in MSIE rather than my default browser (Mozilla).

I am trying to accommodate (pander to?) those who are unenthusiastic about MSIE (like me).
 

Users who are viewing this thread

Back
Top Bottom