|
-
Jun 24th, 2000, 05:39 PM
#1
Thread Starter
Member
how do i get a list of all the files in a directory?
-
Jun 24th, 2000, 06:05 PM
#2
set a reference to Microsoft Scripting Runtime and add a listbox to the form then stick this code in somewhere:
Code:
Dim MyFSO As New FileSystemObject
Dim MyFolder As Folder
Dim MyFile As File
Set MyFolder = MyFSO.GetFolder("C:\Windows\Desktop")
For Each MyFile In MyFolder.Files
List1.AddItem MyFile.Name
Next MyFile
Nice and quick! Read up on the FSO to find out more of the cool stuf it does. (its loads better than the DIR() function).
-
Jun 24th, 2000, 08:23 PM
#3
Lively Member
wossname's reply looks good
perhaps he can tell me how to set a reference to Microsoft Scripting Runtime
cheers
-
Jun 24th, 2000, 10:13 PM
#4
yep,
click on the Project menu and then click Refernces (theres no keyboard shortcut that I know of) you will find a whole bunch of useful DLL's and bits, find the one named "Microsoft Scripting Runtime" and check the box next to it.
the first thing you will notice is some new variable types become available.
Hows that?
-
Jun 25th, 2000, 12:42 AM
#5
Lively Member
cheers wossname
looks very useful
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
|