FileSystemObjectフォルダ再帰検索
Option ExplicitPrivate Sub Command1_Click()
Dim fs As Object, fld As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Set fld = fs.GetFolder("C:\TEMP")
DispFolders fld
Set fld = Nothing
Set fs = Nothing
End SubPrivate Sub DispFolders(oFolder As Object)
Dim oSubFolder As Object
Debug.Print oFolder.Path
For Each oSubFolder In oFolder.SubFolders
DispFolders oSubFolder
Next
End Sub


Comments