Public Sub CheckFolder(strFolder As String, lst1 As ListBox, lst2 As ListBox)
'===================================================================================
Dim strFile As String
Dim intPos As Integer
Dim strCurFile As String
On Error GoTo ErrClear
If Not Right(strFolder, 1) = "\" Then strFolder = strFolder & "\"
strFile = Dir(strFolder, vbNormal)
Do While strFile <> ""
If strFile <> "." And strFile <> ".." Then
If (GetAttr(strFolder & strFile) And vbNormal) = vbNormal Then
intPos = InStrRev(strFile, ".")
If Mid(strFile, intPos - 1, 1) = "1" Then
strCurFile = strFolder & strFile
intPos = InStrRev(strCurFile, ".")
lst1.AddItem strFile & vbTab & FileLen(strCurFile) & " bytes" _
& vbTab & FileDateTime(strCurFile) _
& vbTab & Mid(strCurFile, intPos + 1)
ElseIf Mid(strFile, intPos - 1, 1) = "2" Then
strCurFile = strFolder & strFile
intPos = InStrRev(strCurFile, ".")
lst2.AddItem strFile & vbTab & FileLen(strCurFile) & " bytes" _
& vbTab & FileDateTime(strCurFile) _
& vbTab & Mid(strCurFile, intPos + 1)
End If
End If
End If
strFile = Dir
Loop
Exit Sub
ErrClear:
'-----------
Debug.Print Err.Description
Err.Clear
Resume Next
End Sub