strFolder = "C:\TEMP\FOLDER23"
Dim aFileNameSize(0, 1)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colFolder = objFSO.GetFolder(strFolder)
Set colFiles = colFolder.Files
For Each strFile In colFiles
aFileNameSize(0,0) = strfile.name
aFileNameSize(0,1) = strfile.size
strFileName = aFileNameSize(0,0)
intFileSize = aFileNameSize(0,1)
MsgBox strFileName & ", " & intFileSize & " bytes"
Next
|