Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How ot Open file with assoc app

Status
Not open for further replies.

Alabaster2100

IS-IT--Management
Apr 7, 2001
26
CA
I need to open an access mdb but I dont know if they have access or the runtime. How would I launch the mdb as if I just put in its full path.

Thanks
Alabaster
 
The ShellExecute API function would seem to be what you need.

Put the following at the top of a module :
Code:
Private 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
     
Then use the following to launch any document/file etc. If you pass it an Access filename it should launch Access, etc.
[code]
Private Sub LaunchApp(strFileName As String)
    ShellExecute 0, vbNullString, strFileName, vbNullString, "C:\", 1
End Sub

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top