Results 1 to 9 of 9

Thread: [RESOLVED] Process multiple Files

Hybrid View

  1. #1
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Process multiple Files

    lokiloki2,

    What is the purpose of this code:

    VB Code:
    1. For X = 0 To (List1.ListCount - 1)
    2.  
    3. List1.ListIndex = X
    4. Next
    Last edited by randem; Sep 4th, 2005 at 09:24 PM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Process multiple Files

    This allows you to select multiple filenames to open directly into the CDC.
    VB Code:
    1. Private Sub cmdOpen_Click()
    2.   ' CancelError is True.
    3.    On Error GoTo ErrHandler
    4.    ' Set Flags
    5.     CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames
    6.    ' Set filters.
    7.    CommonDialog1.Filter = "All Files (*.*)|*.*|Text" & _
    8.       "Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
    9.    ' Specify default filter.
    10.    CommonDialog1.FilterIndex = 2
    11.    ' Display the Open dialog box.
    12.    CommonDialog1.ShowOpen
    13.    ' Call the open file procedure.
    14.  '  OpenFile (CommonDialog1.FileName)
    15.    Exit Sub
    16.  
    17. ErrHandler:
    18. ' User pressed Cancel button.
    19.    Exit Sub
    20.  
    21. End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    25

    Re: Process multiple Files

    Should not have been in the code. My bad.

    If List1.ListCount = 0 Then GoTo ext

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    25

    Re: Process multiple Files

    Dglienna,

    The code you posted, will that run the .exe on each file ?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    25

    Re: Process multiple Files

    VB Code:
    1. For X = 0 To (List1.ListCount - 1)
    2.  
    3. List1.ListIndex = X
    4. Next

    Doesn't belong, was testing out some code and forgot to delete this.

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Process multiple Files

    Quote Originally Posted by lokiloki2
    Dglienna,

    The code you posted, will that run the .exe on each file ?
    I'm not sure. I think it will open each one in a separate instance. I know that's the case with Word, for instance. I've never really tried to use it.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    25

    Unhappy Re: Process multiple Files

    This will not work.

    The exe I run on each file listed in the Listbox produces a checksum that I need to save to a textfile. If multiple files are selected in the CommonDialog, only the last line in the listbox gets processed. I need to process each file if someone selects more than one file.

    THX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width