XLEAccessGuru
08-04-2008, 12:54 PM
I know file system object properties code, but I'm over-complicating how to search a file name for a string. For example, I want to find all files in C:\MyFolder that contain "ABC" in the file name.
Like I said, I'm overcomplicating this. Brain fried today so any help on what's probably pretty simple is appreciated. Thanks.
XLEAccessGuru
08-04-2008, 01:00 PM
PS - I won't always be searching for "ABC" as the 1st 3 characters. It may be the last three or in the middle of 50 other characters in the file name.
DCrake
08-04-2008, 11:05 PM
If you transfer your thoughts to how you would perform a search using Windows search utility you would enter soming along the lines *ABC*.* or *ABC*.DOC if you knew the file extension.
What you need to do is to emulate this in your VBA when performing the search.
Prompt the user to enter the known criteria, in this case ABC, then surround it with the wildcard symbols.
CodeMaster::cool:
XLEAccessGuru
08-05-2008, 04:36 AM
Thank you! It's actually not a user prompt, I'm searching for monthly reports that we run automated. I'm getting there though!