This documentation is archived and is not being maintained.

Visual Basic Reference

Visual Studio 6.0

Add Method (Files Collection)

See Also   Example   Applies To

Adds a filename to the Files collection of a DataObject object.


object.Add (filename, index)

The Add method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
filename Required. A string that sets the name of the file.
index Optional. An integer specifying the position where you want to insert the member. If no index is specified, the member is added to the end of the collection.


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.