Results 1 to 7 of 7

Thread: Selecting Multiple Files

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    4

    Selecting Multiple Files

    Does anyone know how to create a Dialog box that will allow me to select multiple files, rather than just one? Right now I have it set up to where the user can enter the filenames manually, but I would rather be able to just select all the files at once from just one dialog box.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim sArr() As String
    3.     Dim i As Integer
    4.     CommonDialog1.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
    5.     CommonDialog1.ShowOpen
    6.     sArr = Split(CommonDialog1.FileName, Chr(0))
    7.     For i = 0 To UBound(sArr())
    8.         Debug.Print sArr(i)
    9.     Next i
    10. End Sub
    -= a peet post =-

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    4
    Thanks man, you rule.

  4. #4
    Junior Member
    Join Date
    Jan 1999
    Location
    marietta, ga
    Posts
    17
    Thanks for the tip, but when I select all the files in the folder it returns nothing. It works if I only select a few of the files but not all. And I am not talking about hundreds of files, I am just doing a test of about 20 or so files.

    Got any ideas??
    -Jb Freels
    Data Processing Sup.
    Layton Graphics, Inc.

    The nice thing about standards is that
    there are so many to choose from.

  5. #5
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    the CommonDialog control also has a MaxFileSize Property, it limits to maximum number of filenames it can return...you may have to fiddle with that
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  6. #6
    Junior Member
    Join Date
    Jan 1999
    Location
    marietta, ga
    Posts
    17
    That be it, thanks man!

    Originally posted by darre1
    the CommonDialog control also has a MaxFileSize Property, it limits to maximum number of filenames it can return...you may have to fiddle with that
    -Jb Freels
    Data Processing Sup.
    Layton Graphics, Inc.

    The nice thing about standards is that
    there are so many to choose from.

  7. #7
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    welcome
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

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