Results 1 to 3 of 3

Thread: how to access all files in a folder

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    16

    how to access all files in a folder

    Guys,

    I need to access all files in a folder becuase i need to search for a string in all files that are in Folder. How could I do that. Any input is appreciated.

    Thanks in advance,
    DilSe..

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    16
    Common Guys,

    No body responded to my question though its simple, since an hour..but I found an answer for me...by just writing a for loop. if anyone dont know how to do this, see the following:


    For each file in folder.files

    blah blah.......

    Loop


    Thanks,
    DilSe..

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    VB Code:
    1. Private Sub Form_Load()
    2. File1.Path = "c:\windows"
    3. For i = 0 To File1.ListCount - 1
    4. If InStr(1, File1.List(i), "mystring") Then
    5.  
    6. End If
    7. Next i
    8. End Sub

    Needs a FileBox.

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