We help IT Professionals succeed at work.
Get Started

catch multiple file attachments from Groupwise in winforms vb.net

Last Modified: 2013-11-25
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
            e.Effect = DragDropEffects.None
            Exit Sub
        End If

        If Not System.IO.File.Exists(strfilename) Then
            MsgBox("File not found")
            MsgBox("File was found")
        End If


Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE