2 Replies - 3593 Views - Last Post: 04 November 2009 - 02:06 AM Rate Topic: -----

#1 C66  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 09-September 09

Drop e-mail attachment

Posted 02 November 2009 - 03:07 PM

I want to do drag and drop with an e-mail attachment (Outlook). The DragDrop event handler comprises the following lines of code
If e.Data.GetDataPresent("FileGroupDescriptor") Then
  Dim ms As System.IO.MemoryStream = CType(e.Data.GetData("FileGroupDescriptor"), System.IO.MemoryStream)

which should be the beginning for retrieving the name of the file to be dropped. -- BUT, after executing the second line, ms is Nothing and stream operations (seek or read) with ms fail. Why? How can ms be Nothing if e.Data.GetDataPresent("FileGroupDescriptor") was True? -- Any help would be much appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Drop e-mail attachment

#2 CapeCAD  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 64
  • Joined: 10-August 09

Re: Drop e-mail attachment

Posted 02 November 2009 - 04:49 PM

View PostC66, on 2 Nov, 2009 - 04:07 PM, said:

I want to do drag and drop with an e-mail attachment (Outlook). The DragDrop event handler comprises the following lines of code
If e.Data.GetDataPresent("FileGroupDescriptor") Then
  Dim ms As System.IO.MemoryStream = CType(e.Data.GetData("FileGroupDescriptor"), System.IO.MemoryStream)

which should be the beginning for retrieving the name of the file to be dropped. -- BUT, after executing the second line, ms is Nothing and stream operations (seek or read) with ms fail. Why? How can ms be Nothing if e.Data.GetDataPresent("FileGroupDescriptor") was True? -- Any help would be much appreciated.


Try it with a New MemoryStream....

Dim ms As New System.IO.MemoryStream

Was This Post Helpful? 0
  • +
  • -

#3 dzone41  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 46
  • View blog
  • Posts: 216
  • Joined: 21-August 09

Re: Drop e-mail attachment

Posted 04 November 2009 - 02:06 AM

If the previous post does not work for you, check out my tutorial on dragging and dropping files.
http://www.dreaminco...topic132491.htm
Since an e-mail attatchment is a file, this may be the only way, but I'm not sure. Let me know.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1