Opeing a File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have an application where a Files name & Path are stored & then have the
ability to have a User open them.

First I was using Application.FollowHyperlink & it works fine except
sometimes I get the following Default Access Msgbox

"Hyperlinks can be harmful to your computer and data. To protect your
computer, click only those hyperlinks from trusted sources. Do you want to
continue ? "

I cant figure out a way to get rid of or TRAP this err as I dont want it to
appear. Through research, I found that this can be disabled entering a
registry setting. But I dont like this option becuase I cant do this on
every workstation becuase of security. Anyone have any other ideas how to
get rid of this message ? OR

Then through more research I found a file can be opened using:

Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hWnd As Long, _
ByVal lpOperation As
String, _
ByVal lpFile As String, _
ByVal lpParameters As
String, _
ByVal lpDirectory As
String, _
ByVal nShowCmd As Long)
As Long

ShellExecute Application.hWndAccessApp, "Open", strJustFileName, "",
strDirectory, 1

This works fine, but if a file name has an extension that is not registered,
it just does nothing. Is their any way to check or trap this so I can
display a message saying "Unknown File Type" or even better to bring up the
Windows Dialog box to Choose from a list of programs to open the file with ?

Any help would be greatly appreciated.

Thank you,
Jeff
 
Back
Top