Results 1 to 4 of 4

Thread: Recursively retrieve files in a folder

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    7

    Unhappy

    hi!

    anybody who knows how to to recursively retrieve the file names found inside a particular folder?

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Ireland, Dublin
    Posts
    76

    Talking

    Use the FindFirstFile and the FindNextFile API functions.
    There is a good example on http://www.vbapi.com.

    Hope that is some help.

    IJ
    ---------------------------------
    TopMan
    ---------------------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    7
    actually i've found a way to my problem. for this piece of code to work, you must have 2 file list box on a form, called UploadedFile and CheckedFile. it will retrieve the first file from UploadedFile, process it and move it over to CheckedFile. in this way i can get hold to each of the file, one at a time. one feature that i wanted to achieve has been successful too: to add files while i'm processing a file at the same time. that's why i've the Refresh function to constantly check if there's any new file.



    Private Sub Start_Click()

    On Error Resume Next

    UploadedFile.Refresh
    UploadedFile.ListIndex = 0

    While UploadedFile.ListCount > 0

    'Process the first file here

    FileCopy Source, Destination
    Kill Source

    UploadedFile.Refresh
    UploadedFile.ListIndex = 0
    CheckedFile.Refresh

    Wend

    End Sub

  4. #4
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Yes of course, I will send you the algorithm if you want.

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