Creating a hard copy of files listed in a folder

J

Jim J

All,
I would like to create a hard copy of all the .txt files
listed in "C:\Files\work". I need to open up all of these
files, (approx. 100 files are in this directory) one at a
time and do a search for a certain string. I can do all
the search stuff, I just don't know how to create the
list.

Thanks,
Jim
 
D

Duane Hookom

Here is a sample function that will debug print the file names. It could be
modified to append the names to a table or whatever.

Function GetFileNames(pstrFind As String)
Dim strFile As String
strFile = Dir(pstrFind)

Do Until Len(strFile) = 0
Debug.Print strFile
strFile = Dir()
Loop
End Function
 

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