|
-
Jun 14th, 2000, 09:59 PM
#1
Thread Starter
_______
'I want to list the file names but not
'sure how to call them
myFolder = "a:\image viewer\images"
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FSO = FSO.GetFolder(myFolder)
iLen = FSO.Files.Count
ReDim iArray(iLen)
For iCount = 1 To iLen
iArray(iCount) = 'how do I get the file name here
List1.AddItem iArray(iCount)
Next
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 14th, 2000, 10:04 PM
#2
Addicted Member
try something like this instead;
Code:
Set objFilesys = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFilesys.GetFolder(strFolderPath)
Set collFiles = objFolder.Files
For Each objFile in collFiles
'..do whatever you want with the file name
'..i.e store to an array
Next
good luck
/d8/
-
Jun 14th, 2000, 10:13 PM
#3
Thread Starter
_______
..the best...
works like a charm...all I wanted to do
was to uppercase all the filenames in a
given folder and your way beats the crap
out of my idea...
thanks...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 14th, 2000, 10:39 PM
#4
Fanatic Member
Or altreantivley, if you do not want to have to include the scripting runtime libraries with your project.
Code:
Dim stFile as String
stFile = Dir$("c:\path\*.*")
Do While stFile <> ""
List1.Additem stFile
stFile = Dir
Loop
Iain, thats with an i by the way!
-
Jun 15th, 2000, 12:31 AM
#5
Addicted Member
me = one-upped !!

Secret to long life:
Keep breathing as long as possible.
-
Jun 15th, 2000, 05:41 AM
#6
Thread Starter
_______
scripting
Yup...I use it for two or three other functions in the app so I have to load it...
will keep the (without fso code)..add it to my database for future reference..
thanks
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|