Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Opeing a File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 09 Apr 2005 01:21 GMT
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
Douglas J. Steele - 09 Apr 2005 12:44 GMT
You can't trap the error. You'll need to set the security level to low on
the machine.

As to the second part, the sample code in
http://www.mvps.org/access/api/api0018.htm at "The Access Web" brings up the
Windows dialog for unknown extensions.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hello,
>
[quoted text clipped - 47 lines]
> Thank you,
> Jeff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.