Framework EDI Reference. Methods and Properties
ediFiles. GetFileByIndex

Returns an object in the collection at the index location specified.

Syntax:

Parameter:

Returns:

Returns an object of type FREDI.ediFile if the operation is successful and the object is found in the collection; otherwise an empty value is returned for a failed operation or the object is not found.

Remarks

The ediFile object can contain information of a file or of a folder.

 

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oFileSystem As Fredi.ediFileSystem
Dim oFiles As Fredi.ediFiles
Dim oFile As Fredi.ediFile
Dim sFilesList As String
Dim i As Integer

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Get file system object.
Set oFileSystem = oEdiDoc.GetFileSystem

' Get the files in the folder.
Set oFiles = oFileSystem.GetDirectory(App.Path & "\SomeFolder\")

sFilesList = vbCrLf

For i = 1 To oFiles.Count

Set oFile = oFiles.GetFileByIndex(i)

sFilesList = sFilesList & oFile.FileName & vbCrLf
Next

MsgBox sFilesList

Samples