Hello:
I am using the following code to iterate through subfolders.The problem is that the depth of folders may change and this code only processes to the first level. How do i change it to process the folders regardless of the depth of folders? Thank you.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If txtFileName.Text = "" Then
txtFileName.SetFocus
Exit Sub
End If
Dim fs, f, f1, s, sf
Dim r As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Dir1.Path)
Set sf = f.SubFolders
For Each f1 In sf
s = f1.Path & "\00000001.TIF"
s = s & vbCrLf & f1.Path & "\00000002.TIF"
AppendToFile r, s
s = ""
Next
MsgBox "Done..."
I am using the following code to iterate through subfolders.The problem is that the depth of folders may change and this code only processes to the first level. How do i change it to process the folders regardless of the depth of folders? Thank you.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If txtFileName.Text = "" Then
txtFileName.SetFocus
Exit Sub
End If
Dim fs, f, f1, s, sf
Dim r As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Dir1.Path)
Set sf = f.SubFolders
For Each f1 In sf
s = f1.Path & "\00000001.TIF"
s = s & vbCrLf & f1.Path & "\00000002.TIF"
AppendToFile r, s
s = ""
Next
MsgBox "Done..."