Drag and Drop Outlook E-Mails

I am trying to create an app that allows dragging and dropping of E-Mails to my application. I have tried the code above with the latest version of Aspose.Emails, and it doesn’t work. The file names come out empty.



Can you let me know what the status of the above is?

Hi Robert,


I have tested the code WpfDragDropTest_4_0.zip in the above post using latest version Aspose.Email for .NET 6.2.0 and observed no issue. Complete msg file name and attachment names are displayed properly. Could you please test the above mentioned code again using latest version and share the feedback?

The code is for WPF. I am creating a Winforms application. So I don’t have the WPF FileDropPanel. The code I am talking about is this:



Dim args As Aspose.Windows.Forms.FileDragEventArgs

args = DirectCast(dragdropArgs, Aspose.Windows.Forms.FileDragEventArgs)



If args IsNot Nothing AndAlso args.Files.Count > 0 Then



No files are returned when dragging and dropping an E-Mail.

Hi Robert,

We have further tested this issue at our end with Windows Form application and didn’t face any issue as you have shared. The information is displayed properly when the message is dragged to the sample application. Please try the attached application with this post and let us know your feedback.

I took a look at the program, and it doesn’t work at all. Sorry to say this, but something is seriously wrong here. Please take a look at your code. The drag event isn’t wired up correctly.

Hi Robert,

The sample project works fine at our end and retrieves the information properly. We are using MS Outlook 2013 configured with Exchange Server 2010. Have you included the InterOp library in the project? If possible, please send us your sample project that you are using to verify this issue. Also, please make sure that you are using the latest version of the API.

I am not able to get your project to work. I will not be using the Microsoft Interop. Also, you are using your own custom panel to drop into. This is not going to work for me. I need to form itself to be the object that accepts the drop. If I take just your code that does the drop part, and put it on the form, I don’t get the file names. So the way that you have it might work for you, but it won’t work for me. So if you can show me how to do this in a form without using Microsoft.Interop and without using your custom panel, I should be able to get it working.

I managed to get your program converted so that it doesn’t use Microsoft.Interop or it’s own custom panel. So the code now works for dropping of E-Mails. But when I try and drop a regular file, I get a “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” error. That is with no exception throwing selected. This is happens on Windows 10 64Bit. The only way I could get the program to work was forcing it to be 32bit.

Hi Robert,

We are investigating this issue further and will write to you soon about our findings. We apologize for the delay incurred in this regard.

Any new for me on this issue? This is something that I need to get working. I have a project on hold till this is sorted out. So please let me know what the timeline is. If your product cannot do the drag and drop, I am going to have to find something that does.

Hi Robert,

Thank you for being patient while we investigated the issue.

We have tested this issue with both Windows 7 & 10 at our end, but no error was raised in 64 and 32-bit settings. The issue was tested with your sample application as well as a new project from our end (that is exact replica of your sample application) and both applications behaved according to expectations. The following steps were carried out for testing the issue.

1. Messages from Outlook were dragged and dropped to the sample application and no error was raised.
2. Non-Message files such as .Txt, .Docx, etc. were dropped from MS Outlook to this sample application and no error was raised
3. Non-Message files from desktop were dragged and dropped to this sample application and no error was raised.

I would request you to please share complete stack trace of the exception you are getting for our investigation. This will help us investigate the issue and assist you further.