A drag and drop problem in Outlook and .Net

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
 
J

Justin Rogers

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top