Fill ListBox with File Names given Path

I need to fill a Listbox with the Names of Files in a Directory. I want code, I dont want to use a filelistbox.
fred12Asked:
Who is Participating?
 
OeilNoirConnect With a Mentor Commented:
this will do what you want... when you call the "dir" function without parameters, the dir function return the next file matching the patern....

dim strFile as string

strfile = dir("c:\path\*.*")
do while strfile <> ""
   list1.additem strfile
   strfile = dir
loop
   
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.