Page 1 of 1

Find ALL files in a directory

Posted: Thu Aug 11, 2011 10:15 am
by Darren
Can anybody help?

Say that you have a folder with hundreds of notepad "txt" files. How, using FindFirst$ & FindNext$, can I list them to a ListBox. I have tried but I am having trouble with FindNext$. It seems to "skip" files.

Does anybody have an example?

Many thanks in advance!!!

Darren

Find ALL files in a directory

Posted: Thu Sep 29, 2011 10:26 am
by Quartermars
[quote author=7A607C70727E130 link=1313057733/0#0 date=1313057733]Can anybody help?

Say that you have a folder with hundreds of notepad "txt" files. How, using FindFirst$ & FindNext$, can I list them to a ListBox. I have tried but I am having trouble with FindNext$. It seems to "skip" files.


Well you can try this example....I know it has worked for me...
sub DirectoryListing()
     Dim TempStr as string
     RichWin.text=Findfirst$("*.txt")
     do
     TempStr = FindNext$
     RichWin.text=RichWin.text + chr$(10)+TempStr
     loop until TempStr=""
end sub

Does anybody have an example?

Many thanks in advance!!!

Darren[/quote]