none
Userform - Files Drag&Drop into a ListBox RRS feed

  • Question

  • Hi,

    I try to realize a macro in an Userform to automatically generate a mail with attachments.
    The principle is to drag attachment files into a ListBox that will grab the file link.

    The text drag&drop is ok with the following code (recover on the net so I don't understand it completely)

    My problem : This code doesn't work with file links.

    I think "GetText" is not appropriate for me but I don't know how replace it...

    Please Help Me !!

    Vlv35

    Private Sub ListBox1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, _
    ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal y As Single, _
    ByVal DragState As Long, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
        Cancel = True
        Effect = 1
    End Sub
     
    Private Sub ListBox1_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, _
    ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, _
    ByVal X As Single, ByVal y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
        Cancel = True
        Effect = 1
     
        ListBox1.AddItem Data.GetText
    End Sub 

    Thursday, October 23, 2014 7:36 AM

All replies