Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for characters in filename. 1

Status
Not open for further replies.

wachuna

Technical User
Mar 10, 2004
14
0
0
US
After getting the filename in a directory, how do I check the filename to see if it contains the characters that I'm looking for? For example, filename is k30pw003idaho.pdf, and I want to see if it contains characters "pw".
Thank you
 
Something like this ?
If InStr(strFileName, "pw") > 0 Then
MsgBox strFileName & " meets criteria"
End If

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top