test for existance of file by extension

B

BobbyS

How do I test for the existance of files with a .txt in a given folder?

Thank you.
 
M

Marshall Barton

BobbyS said:
How do I test for the existance of files with a .txt in a given folder?


Dir(strPath & "\*.txt") will take care of this. It returns
a zero length string if there is no file to find, or the
first file name if one is found (subsequent calls to Dir()
will return the next file name that matches).
 
Top