Home » File/Folder Handling » How to use Dir$ function to get filenames and display in a list box or something.
How to use Dir$ function to get filenames and display in a list box or something.
Posted on July 25, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 'File/Folder Handling - How to use Dir$ function to get filenames and display in a list box or something. strFilename = Dir$(strPath & "*.*", 63) strfullpath = strPath & strFilename Do Until Len(strFilename) = 0 If Not (strFilename = "." Or strFilename = "..") Then 'Add to list (you decide) with full path recorded somewhere and filename 'displayed lst.Add strfullpath, strFilename End If 'blank file name as otherwise it won't be set to zero length and you'd 'endlessly loop strFilename = "" strFilename = Dir$ Loop |
Enjoy this article?
Filed under: File/Folder Handling
Leave a comment