Share via


Visual Basic Reference

Files Property

See Also    Example    Applies To

Returns a DataObjectFiles collection, which in turn contains a list of all filenames used by a DataObject object (such as the names of files that a user drags to or from the Windows File Explorer.)

Syntax

object.Files(index)

The Files collection syntax has these parts:

Part Description
object An object expression that evaluates to a DataObject object.
index An integer which is an index to an array of filenames.

Remarks

The Files collection is filled with filenames only when the DataObject object contains data of type vbCFFiles. (The DataObject object can contain several different types of data.) You can iterate through the collection to retrieve the list of file names.

The Files collection can be filled to allow Visual Basic applications to act as a drag source for a list of files.