Use Dir() for multiple file extensions?

  • Thread starter Thread starter kiln
  • Start date Start date
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
 
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.
 
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...
 
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
 
Back
Top