|
-
Apr 16th, 2000, 09:41 PM
#1
I've created a folder filled with HTML files from my Temporary Internet Files folder. What I want to do is open the first (or most recent) file to search.
As I won't know the name of the file is there anyway of say, populating a list box with filenames, or something, so I can just work my way down the list scanning each file?
Thanks
Mafro
-
Apr 16th, 2000, 10:33 PM
#2
Addicted Member
Just use a FileListBox (if you're using VB6). Otherwise, use Dir and fill a regular ListBox with all the filenames.
-
Apr 17th, 2000, 02:50 AM
#3
If you do not want to add list boxes to your form
use the file system object.
[
Sub ShowFileList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strFolderNameVariable)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & vbCrLf
Next
MsgBox s
End Sub
]
-
Apr 17th, 2000, 02:58 AM
#4
Code:
Sub ShowFileList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf
Next
MsgBox s
End Sub
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
|