如:打开MDB文件用ACCESS 打开DOC文件用WORD

解决方案 »

  1.   

    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
    Private Sub Command1_Click()
        ShellExecute Me.hwnd, "open", "c:\test.txt", vbNullString, vbNullString, 3
    End Sub至于用程序指定文件,用打开文件对话框就可以了