Link to home
Start Free TrialLog in
Avatar of codefinger
codefingerFlag for United States of America

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()

Open in new window

Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of codefinger

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
Avatar of codefinger
codefinger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial