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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top