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 LongPrivate Sub Command1_Click() ShellExecute Me.hwnd, "Open", "aa.doc", "", App.Path, 1 'WORD End SubPrivate Sub Command2_Click() ShellExecute Me.hwnd, "Open", "Book1.xls", "", App.Path, 1'EXCEL End Sub
ShellExecute Me.hwnd, "Open", "aa.doc", "", App.Path, 1 'WORD
End SubPrivate Sub Command2_Click()
ShellExecute Me.hwnd, "Open", "Book1.xls", "", App.Path, 1'EXCEL
End Sub