用shell(),我打不开。

解决方案 »

  1.   

    ShellExecute
    HINSTANCE ShellExecute(
        HWND hwnd, 
        LPCTSTR lpOperation,
        LPCTSTR lpFile, 
        LPCTSTR lpParameters, 
        LPCTSTR lpDirectory,
        INT nShowCmd
    ); The ShellExecute function opens or prints a specified file. The file can be an executable file or a document file.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
    Const SW_SHOWNORMAL = 1
    Private Sub Form_Load()
        ShellExecute Me.hwnd, vbNullString, "F:\CSDN.XLS", vbNullString, vbNullString, SW_SHOWNORMAL
        ShellExecute Me.hwnd, vbNullString, "F:\CSDN.DOC", vbNullString, vbNullString, SW_SHOWNORMAL
    End Sub