How to drag and drop an attachment file from Outlook?

Posted by Peter van Dam on 18-Jul-2013 09:54

I am wondering how you can drop an attached file from outlook on a GUI for .NET container.

I have the samples from Consultingwerk where you can drop an email, but not an attachment.

How can you achieve that?

Thanks,

-peter

All Replies

Posted by Peter van Dam on 24-Jul-2013 04:57

No takers? Can anyone claim if it is possible or not to drop an attachment file from Outlook?

Posted by Admin on 24-Jul-2013 05:08

This works. Trick is, that there is no real file, only data in memory during drag and drop

http://codecruiser.wordpress.com/2010/07/20/drag-outlook-attachment-to-your-winform/

Posted by Peter van Dam on 24-Jul-2013 05:18

mikefe wrote:

This works. Trick is, that there is no real file, only data in memory during drag and drop

Hi Mike,

Yes I konw that and you demonstrate that nicely in your Consultingwerk/Samples/DragAndDrop/OutlookDragAndDrop.cls for messages.

You can drag a message onto the form and it gets converted.

However, if I drag an attached file from a message to that form the mouse cursor does not change to allow me to drop that attachment on the form so I cannot start converting it.

What am I missing?

Thanks,

-peter

Posted by Admin on 24-Jul-2013 13:08

What am I missing?

 

Probably the DragEnter event handler evaluating the e:Data property (much in the same way as the start of the DragDrop event handler from the blog post) and assigning the e:Effect to acknowledge the ability to receive the e:Data object for the case that the user raises the mouse button (which will trigger the DragDrop event).

Also the AllowDrop property of the receiving object needs to be set to true (a welcome mistake).

Posted by Peter van Dam on 24-Jul-2013 15:28

Aha now I see what you mean.

OK I will try to convert the code to OOABL and post back here when I have figured it all out.

Thanks!

This thread is closed