Loop List of File Names from Folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to loop through a list of files in a particular folder and
assign them to variables. I will have the path of the folder, so the only
thing that I need is to loop through each, individual file and assign
variables (file1, file2, et al.) to each.

Any help is greatly appreciated. Thanks.

Gary
 
I would like to loop through a list of files in a particular folder and
assign them to variables. I will have the path of the folder, so the only
thing that I need is to loop through each, individual file and assign
variables (file1, file2, et al.) to each.

Any help is greatly appreciated. Thanks.

Gary

Look up the Dir() function in VBA help.
 
Better still, look up the FileSearch Object in Access Help. It will return
an array of file names filtered however you need them.
 
Thanks, Klatuu, that works great. There's only one issue ... PDFs aren't
recognized in the search. Is there a way to have the search recognize ANY
file type? Thanks.

Gary
 
Look in Access Help at the FileSearch object, and read up on the FileType and
FileTypes methods. This will do what you want.
 
Back
Top