Dougy


Hello All

I am relatively new to VBA and have a question that I cant seem to find an answer to on then net. Not sure if it is possible, but here goes anyway. I would like to drag and drop a file path\name from explorer into a text box in an excel form where the text box would then display the full path and file name.

Thanks

D




Re: Dragin and dropin file names

Shasur


Here you have it Dougy

Private Sub TextBox1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
' ------------------------------------------
' Drop Draft Files from Explorer
' ------------------------------------------

Dim i1 As Integer '* Files Counter

On Error GoTo Err_Trap

If Data.GetFormat(vbCFFiles) = True Then
i1 = Data.Files.Count
If i1 = 1 Then
TextBox1.Text = Data.Files(i1)
Else
msgbox "You cannot deop multiple files..."
End If
End If

End Sub

This is done in VB6.0

Cheers

Shasur







Re: Dragin and dropin file names

YaelS

Hi,

I need the same in ms access vba..

How can I get this method

TextBox1_OLEDragDrop

Thank's,

Yael