我有一個文件清單,在程序中打開清單中的文件!

解决方案 »

  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 Form_Load()ShellExecute Me.hWnd, "open", "C:\User.doc", vbNullString, vbNullString, SW_SHOWEnd Sub
      

  2.   

    Option Explicit
    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()
    Dim filename As String
    Open "c:\filelist.txt" For Input As #1
        Do Until EOF(1)
            Input #1, filename
            ShellExecute Me.hwnd, "open", filename, vbNullString, vbNullString, ByVal 0&
        Loop
    Close #1
    End Sub