|
-
Dec 8th, 1999, 10:51 PM
#1
Thread Starter
_______
I would like to list the filenames of all files in "C:\My Documents"
How do I do this?
I can count them with this but I need to list their names.'count files in a directory
Dim iFiles As Integer
Dim sDir As String
sDir = Dir("C:\My Documents\*.*", vbNormal)
While sDir <> ""
iFiles = iFiles + 1
sDir = Dir
Wend
-
Dec 8th, 1999, 11:08 PM
#2
Add something like MsgBox "The name of file number " & iFiles & " is " & sDir after the iFiles = iFiles + 1 line.
------------------
Marty
-
Dec 9th, 1999, 05:00 AM
#3
Lively Member
i think you would do something like this...
Dim iFiles As Integer
Dim sDir As String
sDir = Dir("C:\My Documents\*.*", vbNormal)
While sDir <> ""
'if youwant to keep count...
iFiles = iFiles + 1
'to add them to a listbox
List1.Additem sDir
sDir = Dir
Wend
--michael
-
Dec 9th, 1999, 01:35 PM
#4
Lively Member
why don't you use the file control "FileListBox"?
e.g.
File1.Path = "C:\My Documents"
-
Dec 9th, 1999, 07:21 PM
#5
Thread Starter
_______
Thank you all..
I have it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|