We help IT Professionals succeed at work.

Listing Files in a folder

fayb
fayb asked
on
Is there an easy way to list all of the files in a particular folder in a text box?
Comment
Watch Question

BRONZE EXPERT
Commented:
Try this:

Option Explicit
'remember to set Text1.MultiLine => True in design time
Private Sub Command1_Click()
Dim fileName As String

fileName = Dir("c:\test\*.*")
Do Until fileName = ""
    Text1.Text = Text1.Text & vbCrLf & fileName
   fileName = Dir
Loop
End Sub

Author

Commented:
Thanks, Works Great

Explore More ContentExplore courses, solutions, and other research materials related to this topic.