I am working with a piece of code that will scroll through directories on a drive searching for a specific file type. ie .txt
The DIR function can filter out files that I am interested in.
My question is, can the same be done with the FileSystemObject?Code:myItem = Dir(myDirectory & "*.TXT")
I am using the following code, but it is looping through about a billion files that I am not interested in.
Any help would be much appreciated.Code:Dim objFolder As Scripting.Folder Dim objFile As Scripting.File For Each objFile In objFolder.Files If UCase(Right(objFile.ShortPath, 4)) = ".TXT" Then '.TXT File Found!!! Next objFile
[This message has been edited by Kevin Burt (edited 11-03-1999).]


Reply With Quote