Share via


Visual Basic Reference

Add Method (DataObjectFiles Collection)

See Also    Example    Applies To

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

Syntax

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 where in the collection you want to insert the filename. If you don't specify an index value, the filename is added to the end of the collection.

Remarks

The Files collection can be filled only with filenames that are of type vbCFFiles (as found in the ClipBoardConstants list in the Object Browser). The DataObject object itself, however, can contain several different types of data. To retrieve a list of file names, iterate through the Files collection.