This method uses DOS to build a text file.
Click on START then RUN. Enter CMD and then click OK.
This opens a DOS window.
Use CD.. to move one level up in folder structure.
Use CD <folder name> to go to lower level folder.
Use <drive letter>: to change drives.
When you are at the correct drive, use DIR to list files
and folders. Use DIR/S to list files and files in lower
folders.
Use DIR/S > Myfilelist.txt to create a text file with all
the file names.
When you finish you can click to close the window.
The VBA Dir() function returns filenames; repeated calls to Dir() will
return additional filenames. You can open a recordset and loop through
it using the AddNew method to insert the names that Dir() finds. See
the VBA online help for Dir.
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.