I've made a standard notepad that saves to a directory using a standard common dialog control, is there a way to have a textbox on the top of my notepad display all of the txt files in that directory?
Printable View
I've made a standard notepad that saves to a directory using a standard common dialog control, is there a way to have a textbox on the top of my notepad display all of the txt files in that directory?
Code:'Use EnumDir to enumerate all files in that directory and join the array and put it int the textbox:
Sub EnumDir(ByRef edir() As String, path As String)
Dim n As Integer, a As String
a = Dir(path)
Do While Len(a)
ReDim Preserve edir(n)
edir(n) = a
n = n + 1
a = Dir
Loop
End Sub
'To use
Dim dirs() As String
EnumDir dirs, "C:\*.txt"
text1 = Join(dirs, " ; ")