Count Property

Return the number of files in the PackageFiles collection.

Syntax

object.Count

The object is an expression that evaluates to a PackageFiles collection. The property returns a numeric value which specifies the number of files in the collection. A value of zero indicates that the collection is empty.

Remarks

You can use this property in conjunction with a For..Next statement to carry out an operation on each file in the collection. For example:

For nIndex = 0 To Package1.Files.Count - 1
    If Package1.Files(nIndex).FileName = strFileName Then
        ' Do something with the file
    End If
Next

Note that if files are deleted from the collection, the value of the Count property and the index values for each file in the collection will change.