PDA

Click to See Complete Forum and Search --> : Easy Way to Add Files to Listview


tane
Aug 26th, 2000, 07:47 AM
What is the easy way to add files to listview Control
i tryed with vba.dir but I can seem to find the way to
put more then one files I am also using fastlib2000 controls but i have the same problem
it would be nice if don't use API calls thx

Crazy D
Aug 26th, 2000, 08:31 AM
Dim sFile As String
sFile = Dir$("C:\*.*")
Do While sFile <> ""
If sFile <> "." And sFile <> ".." Then
List1.Add sFile
End If
' calling dir without a path "resumes" from the last file returned
sFile = Dir
Loop

If you want to include subdirs I guess you're stuck with the FindFirst and FindNext API's, since the Dir "resets" when you call it again with another path.

edit: oh I add the files to a listbox, but I assume you know how to use the listview... :)