Recherche
Recherche
Les mémos
Je débute...
Visites

 1002167 visiteurs

 1 visiteur en ligne

Lister les sous-dossiers

Function fnGetSubFoldersInDirectory(sPath As String) As String
    Dim fso As Object, Directory As Object
    Dim SubFolders As Object, Folders As Object
    Dim sTmp As String
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set Directory = fso.GetFolder(sPath)
    Set SubFolders = Directory.SubFolders
    
    For Each Folders In SubFolders
        sTmp = sTmp & Folders.Name & ";"
    Next Folders
    
    If sTmp <> "" Then
        sTmp = Left(sTmp, Len(sTmp) - 1) & ""
    End If
    
    fnGetSubFoldersInDirectory = sTmp
    
    Set Folders = Nothing
    Set SubFolders = Nothing
    Set fso = Nothing
    Set Directory = Nothing
End Function


Catégorie : Les mémos - Fichiers
Page lue 5582 fois