how do you enum the files in a windows folder?? do you need to use com or is there other ways and how do u do it anyway?
thanx
Posted on 2001-11-26 22:28:01 by Kezza
Function GetFilesInDirS(path As String, Mask As String, MyArray() As String)
'Having been given a directory path, a file mask, and a
'string array to stick the results in, this function
Dim SearchPath As String
Dim Result As String
Dim count As Long
Dim ValResult As Long
count = 0
SearchPath = path
If Len(SearchPath) = 0 Then
SearchPath = "c:\"
End If
If Right$(SearchPath, 1) <> "\" Then
SearchPath = SearchPath & "\"
End If
If Len(Mask) = 0 Then
Mask = "*.*"
End If
Result = Dir$(SearchPath & Mask)
While Len(Result) > 0
count = count + 1
ReDim Preserve MyArray(1 To count)
MyArray(count) = SearchPath & Result
Result = Dir$
Wend
GetFilesInDirS = count
End Function 'GetFilesInDirS.
Posted on 2001-11-26 22:49:57 by peterverstappen
Function GetFilesInDirS(path As String, Mask As String, MyArray() As String)
'Having been given a directory path, a file mask, and a
'string array to stick the results in, this function
Dim SearchPath As String
Dim Result As String
Dim count As Long
Dim ValResult As Long
count = 0
SearchPath = path
If Len(SearchPath) = 0 Then
SearchPath = "c:\"
End If
If Right$(SearchPath, 1) <> "\" Then
SearchPath = SearchPath & "\"
End If
If Len(Mask) = 0 Then
Mask = "*.*"
End If
Result = Dir$(SearchPath & Mask)
While Len(Result) > 0
count = count + 1
ReDim Preserve MyArray(1 To count)
MyArray(count) = SearchPath & Result
Result = Dir$
Wend
GetFilesInDirS = count
End Function 'GetFilesInDirS.
Posted on 2001-11-26 22:52:19 by peterverstappen
Look at FindFirstFile and FindNextFile.
Posted on 2001-11-26 23:03:39 by f0dder