Check out the dir() function. Below is a dump from the Help Example. I've also executed a MS-DOS Dir command to get a list, then imported the list into a database table.
In terms of locating the file with today's date.. you can use the Instr() function to locate the "." then subtract the number of digits for the date. In the If condition of the loop, you can look for file names where mid(filename,Instr(...),x)... = Todays'date.. htwh...
' Display the names in C:\ that represent directories.
MyPath = "c:\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName ' Display entry only if it
End If ' it represents a directory.
End If
MyName = Dir ' Get next entry.
Loop
Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com
Chester County, PA Residents
Please Show Your Support...