21/05/2020, 12:20
Klasördeki tüm alt klasör ve dosyaları Listboxa Almak için şu kodda nasıl bir değişiklik yapmak lazım
Private Sub getSubListFiles(ByVal strFolders As String, intCounter As Integer)
Dim fso As New FileSystemObject
Dim fldFolders As Folder
Dim fldr As Folder
Dim subfldr As Folder
Dim sfldFolders As String
Dim strSQL As String
Set fldFolders = fso.GetFolder(TrailingSlash(strFolders))
Me.listSource.AddItem intCounter & ";" & fldFolders.Path & ";" & fldFolders.Name & ";" & fldFolders.Size
For Each fldr In fldFolders.SubFolders
intCounter = intCounter + 1
Me.listSource.AddItem intCounter & ";" & fldr.Path & "," & fldr.Name & ";" & fldr.Size
For Each subfldr In fldr.SubFolders
intCounter = intCounter + 1
sfldFolders = subfldr.Path
Call subListFolders(sfldFolders, intCounter)
Me.listSource.Requery
Next
Me.txtListed = intCounter
Me.txtListed.Requery
Next
Set fldFolders = Nothing
Set fldr = Nothing
Set subfldr = Nothing
End Sub