A drag and drop problem in Outlook and .Net

  • Thread starter Thread starter BVM
  • Start date Start date
B

BVM

Hi:

I want to drag a mail item from Outlook and drop it in to a listbox. Then the listbox will display the name of the mail item. However this code
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

gives files=null. So how can I do Drag & Drop with Outlook and .NET? Is this very hard one?

Thank you for any help,

Dennis Huang
 
You have to use the appropriate data format. FileDrop is not the right thing. That drops a list of files
that are located on the system. Emails are most likely copied in several ways. First is probably the
text of the email, then an HTML format, probably an OLE Automation format, and some other things.

Play around with the other data formats because that is where you are going to find your email being
stored.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
Hi:

I want to drag a mail item from Outlook and drop it in to a listbox. Then the listbox will display the name of the mail item. However this code
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

gives files=null. So how can I do Drag & Drop with Outlook and .NET? Is this very hard one?

Thank you for any help,

Dennis Huang
 
Back
Top