Dead Easy using Recursion...
I made this code yesterday for a completely different purpose, but it would work fine with a little alteration.
(you must use the project menu to set a reference to the Microsoft Scripting Runtime (scrrun.dll) to use this. this will take all of 5 seconds to do!)
to try this just put a button and a listbox on a form, it will add every single file and every single folder's names (that live under the "c:\windows\desktop") to the listbox.
This shows that you dont need bloated API code to do something this simple............
Code:
Option Explicit
Dim MyFSO As New FileSystemObject
Dim FSOFolder As Folder
Sub RecurseDirs(MyFolder As Folder)
Dim FSOSubFolders As Folders
Dim FSOFiles As Files
Dim FSOFile As File
Dim TempFolder As Folder
Set FSOSubFolders = MyFolder.SubFolders
For Each TempFolder In SF
List1.AddItem "DIR... " & TempFolder.Path
Call RecurseDirs(TempFolder)
Next TempFolder
Set FSOFiles = MyFolder.Files
For Each FSOFile In FSOFiles
List1.AddItem FSOFile.Path
Next FSOFile
End Sub
Private Sub Command1_Click()
List1.Clear
Set FSOFolder = MyFSO.GetFolder("C:\Windows\desktop")
Call RecurseDirs(FSOFolder)
End Sub