Use Dir() for multiple file extensions?

K

kiln

Anyone written an alternate ver of Dir() that will return multiple file
ext types? Expected use would be like

strFileName = FancyDir("c:\*.txt|*.doc")

or something like that? Just trying to save myself some time...

thanks
 
G

Graham Mandeno

Hi Kiln

You can't do this with Dir(), except by looping for one extension, then for
the other, which would not be too difficult.

The other option is to use the FileSearch object.
 
K

kiln

Hi Kiln

You can't do this with Dir(), except by looping for one extension, then for
the other, which would not be too difficult.

The other option is to use the FileSearch object.
thanks, I wrote a custom udf that that does it...
 
C

Chris Nebinger

Only way I could see doing it with DIR is pulling up all
files (C:\Folder\*.*) and then doing a IF statement
against the filetypes that you want to. In a large
directory, this could take a while.


Chris Nebinger
 

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

Top