test for existance of file by extension

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

Guest

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

Thank you.
 
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).
 

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

Back
Top