by Raghu (22 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 18th September 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple Code To List all the Files in a Directory into a List Box
API Declarations
'Controls : List Box,Command Button
Dim Fs as Scripting.FileSystemObject
Dim Fld as Folder
Dim Fls as Files,Fl as File
'=====================================
'For Suggestion and queries mail to
'[email protected]
'=====================================
set fs = CreateObject("Scripting.FileSystemObject")
set fld = fs.GetFolder("C:\") ' You can specify any folder name with path here
set fls = fld.getFiles
list1.clear
for each fl in fls
list1.additem fl.name
next
list1.refresh
End Sub
No comments have been posted about Simple Code To List all the Files in a Directory into a List Box. Why not be the first to post a comment about Simple Code To List all the Files in a Directory into a List Box.