[This is preliminary documentation and subject to change.]
The Filename method returns the filename of the file at the specified index in the cabinet file.
object.Filename( lindex, sFileName )
You can retrieve the number of files in a cabinet using the EnhCab.EnumerateCabinet method.
Windows NT: Unsupported.
Windows: Requires Windows 98.
Windows CE: Unsupported.
Header: Declared in ipenhsnd.idl.
Import Library: Included as a resource in ipenhsnd.dll.
Unicode: Yes.
The following example writes the filename of each file stored in Cab1.htm to a text file.
'Open the output file.
Open "FilesInCab.txt" for Output As #1
'Declare a variable to receive the filename
Dim fname As String
'Loop through the files stored in the cabinet file.
For (i = 0 to numFiles - 1)
'Store the filename of the ith file in fname.
ecab.FileName i, fname
'Print the filename of the ith file to the output file.
Write #1 fname
Next i
'Close the output file.
Close #1
Note that the variable numFiles
contains a count of the number of files stored within the cabinet. To see an example of how to programmatically obtain a file count, see the Examples section of EnhCab.EnumerateCabinet.