I'm assuming you want to put a directory list into a list box.
Drop a list box onto your form. The default name should be List0 which is what I use in my sample below. In an appropriate event call the sub FillList() and pass it the path that you want and the list box will be filled.
Example call:
FillList("C:\"
Sub FillList(strPath As String)
Dim str As String
Dim strTemp As String
strTemp = Dir(strPath)
Do
str = str & strTemp & ";"
strTemp = Dir 'subsequent calls to Dir gets next file
Loop Until Len(strTemp) < 1
List0.RowSource = str
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.