It seems I have a dodgy file in one of my folders and I need to locate it from thousands of pdf's (needle in a haystack.
This following code Lists Directories:
Code: Select all
Function ListDirectories(Path)
'On Error Resume Next
Dir1.Path = Path
For i = 0 To Dir1.ListCount - 1
Dir1.ListIndex = i
Categories = Dir1.List(i)
If Len(Dir(Categories, vbDirectory)) > 1 Then ' Hidden, Read-Only, System files ommited
a(j) = Categories
TreeView1.Nodes.Add "x" & Counter, tvwChild, "x" & j, Dir(a(j), vbDirectory)
j = j + 1
End If
Next i
Counter = Counter + 1
If a(Counter) = "" Then
'MsgBox ("Over")
Else
ListDirectories (a(Counter))
End If
End Function
Greatly Appreciated