Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DIR - List files and directories (2000)

    I want to select a directory then search through all the folders in that directory for text files which my application reads.
    I use the DIR to loop through and list all the directories. Fine.
    I can use the DIR to loop through text files within a directory. Fine.

    But when I combine my code the application finds the first directory, reads through the text files, then falls over when it comes time to loop to the next directory.

    Can the DIR method only be used once? If so how can I accomplish this task?

    Thanks for your help.

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR - List files and directories (2000)

    From the help file: "However, you can't call the Dir function recursively. Calling Dir with the vbDirectory attribute does not continually return subdirectories."

    Take a look at ChDir(), with particular attention to the directories "." and ".."

Posting Permissions

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