EnhCab.FileName

[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.

Syntax

object.Filename( lindex, sFileName )
 

Parts

object
Object expression that resolves to an EnhCab object.
lindex
Long that specifies the 0-based index of the file within the cabinet file.
sFileName
String that receives the name of the file stored at lindex.

Remarks

You can retrieve the number of files in a cabinet using the EnhCab.EnumerateCabinet method.

QuickInfo

  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.

See Also

EnhCab.EnumerateCabinet

Examples

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.