1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Option Explicit
Const Path = "C:\monRepertoire"
MsgBox ShowFolderList(Path)
Function ShowFolderList(strPath)
Dim fso, Dossiers, fic, fichiers, strListe, f, reference, dateReferece
Dim Valeur, imax, z, Cible, liste
Set fso = CreateObject("Scripting.FileSystemObject")
Set Dossiers = fso.GetFolder(Path)
Set fic = Dossiers.Files
Set Reference = fso.GetFile(Path & "\reference.txt")
dateReferece = Reference.DateLastModified
imax = 0
For Each fichiers In fic
Set f = fso.GetFile(fichiers)
imax = imax + 1
ReDim Preserve Tableau(2, imax)
Tableau(1, imax) = f.Name
Tableau(2, imax) = f.DateLastModified
If CDate(dateReferece) < CDate(Tableau(2, imax + 1)) Then
liste = liste & vbCrLf & Tableau(2, imax + 1) & " " & Tableau(1, imax + 1)
End If
Next
ShowFolderList = liste
End Function |
Partager