drag & drop

AadvdV

New member
Local time
Today, 21:17
Joined
Apr 17, 2009
Messages
3
In Access 2007 I try to implement drag & drop using a listview box. If I drop some plain text, it works fine. But if I drop some filenames (e.g. using Explorer), I receive a runtime error 438 "Object doesn't support this property or method". The code (Data.GetFormat(ccCFFiles)) recognizes that the clipboard data is of type ccCFFiles, but other properties / methods (e.g. .files, .getdata, .clear) give a runtime error.

Anybody any idea what's wrong?
 
Check if this code works...
Code:
Private Sub ListView3_OLEDragDrop(Data As Object, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
   Dim objData As MSComctlLib.DataObject
   Dim i As Integer
   Set objData = Data   'provides intellisense enabled object reference
   If objData.GetFormat(ccCFFiles) Then
      With objData.Files
         For i = 1 To .Count
            Debug.Print .Item(i)
         Next
      End With
   End If
End Sub
It seems reasonable that not all members of the DataObject will function for all the datatypes that it may contain.
 
Thanx, that works allright / Aad
 

Users who are viewing this thread

Back
Top Bottom