rockfish12
Technical User
How can I make the following code not only return the subfolders within a folder, but also return subfolders within subfolders, ad infinitum?
______________________________________________________
Sub LoopDeLoop(strPath As String)
Dim objFSO As FileSystemObject
Dim objFolder As Folder
Dim objSubFldr As Folder
Set objFSO = New FileSystemObject
Set objFolder = objFSO.GetFolder(strPath)
For Each objSubFldr In objFolder.SubFolders
Debug.Print objSubFldr.Name
Next objSubFldr
End Sub
______________________________________________________
Sub LoopDeLoop(strPath As String)
Dim objFSO As FileSystemObject
Dim objFolder As Folder
Dim objSubFldr As Folder
Set objFSO = New FileSystemObject
Set objFolder = objFSO.GetFolder(strPath)
For Each objSubFldr In objFolder.SubFolders
Debug.Print objSubFldr.Name
Next objSubFldr
End Sub