J
Jose
How cani I get the list of folders using FileSystemObject?
I can get the folders list until one level down, for example:
I have the following folders:
C:\BLK2DB
AllocSyst
Files
XML
Excel
DB_PASM
Files
Chemicals
I use the following code to get the list folders
Sub ShowFolderList()
Dim strPath As String
strPath = "C:\BLK2DB"
Dim fs, f, f1, fc, s, fr
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strPath)
Debug.Print f
Set fc = f.SubFolders
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf
Next
Debug.Print s
End Sub
The results are:
AllocSyst
DB_PASM
Chemicals
I would like to get all folders
Is is possible?
Thanks,
Jose
I can get the folders list until one level down, for example:
I have the following folders:
C:\BLK2DB
AllocSyst
Files
XML
Excel
DB_PASM
Files
Chemicals
I use the following code to get the list folders
Sub ShowFolderList()
Dim strPath As String
strPath = "C:\BLK2DB"
Dim fs, f, f1, fc, s, fr
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strPath)
Debug.Print f
Set fc = f.SubFolders
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf
Next
Debug.Print s
End Sub
The results are:
AllocSyst
DB_PASM
Chemicals
I would like to get all folders
Is is possible?
Thanks,
Jose