Seeking VisualBasic file system help

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
In a VB program I need to get a list of files in a specific root directory. The ultimate goal is to filter them so I end up with a nice array of filenames of a specific type, so if the filter can be done quickly and easily, that would be great.
 

Pretender

Banned
Mar 14, 2000
7,192
0
0
The solution: move to C++.

I'm not sure if VB has all the same APIs, but if it does, you can try to rig up some magic using FindFirstFile and FindNextFile.
 

way

Senior member
Oct 9, 1999
547
0
0
This worked for me in VBA in MS Word--dunno if that helps you though. InputDirectory is a public variable (i.e. "c:\").

Sub GetInputFileNames()

Dim FName As String
Dim FType As String

FType = "*.doc"
FName = Dir(InputDirectory & FType)
Do Until FName = ""
I = I + 1
ReDim Preserve FNames(1 To I)
FNames(I) = FName
FName = Dir
Loop

FNamesSize = UBound(FNames)

End Sub
 

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
I'm on the way to VC++, but not good enough yet to make this project work. There are... "other" solutions.... mwa ha ha.