It's been so long since I've had a need to do this that I've forgotten how, but using Dir or FSO how do I find picture files in a particular folder on my PC?
Printable View
It's been so long since I've had a need to do this that I've forgotten how, but using Dir or FSO how do I find picture files in a particular folder on my PC?
That's kind of vague. Do you count icons? Or count SVG and other non-native formats as "pictures" too?
A lot depends on what you are going to do, because some approaches will return formats you don't care about.
Even with a list of file extensions to filter for manually there are sometimes variations to consider (JPG and JPEG and JFF). On some systems those will all be registered as images, while on others they won't. That has an impact on stuff like Windows Search queries.
I'd really have to dig deep, because i know i've done something like this in the past
EDIT: Think i found it: https://www.vbforums.com/showthread....=1#post5272397
Yes, it's for deleting files, but there is also a recursive search in there.
MAybe you can use one of the other constants https://learn.microsoft.com/en-us/wi...hfileopstructa
I believe I found what I need using Application.FileDialog(msoFileDialogFilePicker).