Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag and drop multiple attachments

Status
Not open for further replies.

petermeachem

Programmer
Joined
Aug 26, 2000
Messages
2,270
Location
GB
I am using the following code to drag attachments to a form in the dragdrop event
Code:
            Dim memoryStream As System.IO.MemoryStream = e.Data.GetData("FileGroupDescriptor")
            memoryStream.Seek(76, IO.SeekOrigin.Begin)
            Dim fileName As Byte() = New Byte(256) {}
            'return the file name in the fileName variable
            MemoryStream.Read(fileName, 0, 256)

            Dim encoding As System.Text.Encoding = System.Text.Encoding.ASCII
            'convert to byte arry to string
            Dim strFileName As String = encoding.GetString(fileName)
            'trim the strFileName to get the correct file name
            strFileName = strFileName.TrimEnd("")

            MemoryStream = e.Data.GetData("FileContents")
            'write the file content to a file under the same path of the exe file.
            Dim fs As New IO.FileStream(strFileName, IO.FileMode.Create)
            MemoryStream.WriteTo(fs)
            fs.Close()
            c = strFileName
It works very well, but users want to drag several files at once. I can't find any way to do that. Can anyone help?
 
I have the same problem. Users want the ability to select 2 out of 3 outlook attachments to drag and drop. Anyone have a solution?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top