Listing files in a directory

A

Andy Levy

Hi ya

If i wanted to list all the files in a particular directory - is there a way
to do it.

Thanks
AL
 
D

Dan Artuso

Hi,
Here's a routine that will print all files in a directory to the
debug window. Call it like: FindFiles "C:\"

Public Sub ListFiles(ByVal Path As String)
Dim fn As String

fn = Dir$(Path & "*.*")
While Len(fn)
Debug.Print fn
fn = Dir$
Wend

End Sub
 
Top