codefinger
asked on
catch multiple file attachments from Groupwise in winforms vb.net
The code attached will process ONE file dragged from a Groupwise message on to a winforms ListBox. What I need now is how to discover and process them if the user drags over several files from Groupwise at one time.
Dim ob As System.Object = Nothing
Dim ms As System.IO.MemoryStream
ms = e.Data.GetData("attachment format", True)
Dim b(ms.Length) As Byte
ms.Read(b, 0, b.Length)
strfilename = System.Text.Encoding.Unicode.GetString(b)
'//The path/filename is at position 10.
strfilename = strfilename.Substring(10)
strfilename = ctrl.GetLongPathName(strfilename)
If strfilename.EndsWith("pdf", StringComparison.CurrentCultureIgnoreCase) Or _
strfilename.EndsWith("gif", StringComparison.CurrentCultureIgnoreCase) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
ms.Close()
Exit Sub
End If
If Not System.IO.File.Exists(strfilename) Then
MsgBox("File not found")
Else
MsgBox("File was found")
End If
ms.Close()
How do you select multiple attachments? When I added the functionality in my project to accept Outlook attachment dropped on it, I thought about multiple attachments. But I could not drag multiple attachments from Outlook.
ASKER
Groupwise may have several files attached to a single email. To select multiple attachments, click on one, hold down shift key (or ctrl key), click another, then drag files to destination.
.
.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.