# Files
{: .no_toc }

Returns a [**DataObjectFiles**](/tB/Packages/VBRUN/DataObject/DataObjectFiles.md) collection holding the file paths the **DataObject** contains.

Syntax: *object*.**Files**

*object*
: *required* An object expression that evaluates to a **DataObject**.

This is the typical way to read the payload of a Windows shell drag-and-drop, which arrives as a list of fully qualified paths under the `vbCFFiles` clipboard format. Each element of the collection is a **String**.

The source side may also fill the **DataObject** with a list of files by adding paths to this collection --- see [**DataObjectFiles.Add**](/tB/Packages/VBRUN/DataObject/DataObjectFiles.md#add).

### Example

```tb check_build
Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, _
                             Shift As Integer, X As Single, Y As Single)
    If Data.GetFormat(vbCFFiles) Then
        Dim Path As Variant
        For Each Path In Data.Files
            Debug.Print Path
        Next Path
    End If
End Sub
```

### See Also

- [DataObjectFiles](/tB/Packages/VBRUN/DataObject/DataObjectFiles.md) collection
- [GetFormat](/tB/Packages/VBRUN/DataObject/GetFormat.md) method
- [SetData](/tB/Packages/VBRUN/DataObject/SetData.md) method
