Since it looks as though you're using VB6, it's also quite simple to use the
Dir() function to retrieve file names. For example, to read all the filenames in the folder Veena used...
- Dim FileName As String
-
FileName = Dir("C:\MyFolder") ' Find first matching file.
-
Do While FileName <> ""
-
Debug.Print FileName
-
FileName = Dir ' No parameters. Just gets next match.
-
Loop
The advantage of this is that it's quick and simple. It doesn't require a form, a control, or (as the FileSystemObject would) any extra references.