-
Is there a way to get all the files (full file name strings) in a given directory into an array without using the File System Object. I would do a for each loop on the array. Also, I do not need recursion, there's no need to get any directories in the given directory, just the files.
Thanks,
Josh
-
..search
do a search on this site with some keywords...
u'll find something
-
-
Put a command button on a form and put this code in it's click event:
Code:
Private Sub Command1_Click()
Dim arrFileHolder() As String
Dim strFileName As String
Dim intArrayIndex As Integer
intArrayIndex = 0
strFileName = Dir("C:\windows\desktop\")
While strFileName <> ""
ReDim Preserve arrFileHolder(intArrayIndex + 1)
arrFileHolder(intArrayIndex) = strFileName
strFileName = Dir
intArrayIndex = intArrayIndex + 1
Wend
Dim times As Integer
For times = 0 To intArrayIndex
Debug.Print arrFileHolder(times)
Next times
End Sub
Then, look in your Debug window...You'll see all of your files on your desktop...
Hope that helps...
Morgan
-
Thanks, that's what I needed. Combining that with a few API calls I can remove a form and scrrun.dll from my program.
Josh