Hi,
I have a problem ...
In a directory (c:\test) are some files.
there are 5 *.bmp's and 2 *.exe's and 3 *.zip's.
I wand to capture in a array the names of the *.bmp's.
thanks
R@emdonck
Printable View
Hi,
I have a problem ...
In a directory (c:\test) are some files.
there are 5 *.bmp's and 2 *.exe's and 3 *.zip's.
I wand to capture in a array the names of the *.bmp's.
thanks
R@emdonck
Code:'access all bmp files within a folder
Private Sub Command1_Click()
Dim stFile As String
Dim stDir As String
Dim myArr()
Dim i As Integer
stDir = "C:\Test\"
stFile = Dir$(stDir & "*.bmp")
Do While stFile <> ""
ReDim Preserve myArr(i)
'if you want the path as well it would be
'myarr(i) = stdir & stfile
myArr(i) = stFile
i = i + 1
stFile = Dir
Loop
End Sub