C
curtis m. west
hi NG
sorry for this maybe stupid question:
i have this construction:
----->>>> CUT ON <<<<<-----
Dim objFso As Object
Dim objFolder As Object
Dim objFile As Object
objFso = CreateObject("Scripting.FileSystemObject")
objFolder = objFso.GetFolder("<mypath>")
For Each objFile In objFolder.Files
Console.WriteLine(objFile.Name)
Next
objFile = Nothing
objFolder = Nothing
objFso = Nothing
----->>>>> CUT OFF <<<<<----
so far, so good. but how can i get only
ONE filename - only the name of the
"first" file. i don't care about a special
order.
"Files" seems to be a collection
of "file-objects", so how can i
access only one item?
my guess would be anything like:
objFile = objFolder.Files.Item(1)
objFile = objFolder.Files(1)
objFile = objFolder.Files[1]
instead of the "for each next"-construction...
but - no success yet...
thanks for a short feedback
greetz, curtis
sorry for this maybe stupid question:
i have this construction:
----->>>> CUT ON <<<<<-----
Dim objFso As Object
Dim objFolder As Object
Dim objFile As Object
objFso = CreateObject("Scripting.FileSystemObject")
objFolder = objFso.GetFolder("<mypath>")
For Each objFile In objFolder.Files
Console.WriteLine(objFile.Name)
Next
objFile = Nothing
objFolder = Nothing
objFso = Nothing
----->>>>> CUT OFF <<<<<----
so far, so good. but how can i get only
ONE filename - only the name of the
"first" file. i don't care about a special
order.
"Files" seems to be a collection
of "file-objects", so how can i
access only one item?
my guess would be anything like:
objFile = objFolder.Files.Item(1)
objFile = objFolder.Files(1)
objFile = objFolder.Files[1]
instead of the "for each next"-construction...
but - no success yet...

thanks for a short feedback
greetz, curtis