I would like to be able to drag and drop emails and calendar entries from Outlook into my .NET windows forms applications, and whilst I have this working for messages, I am struggling with Outlook calendar entries.
I have implemented the Aspose.Email.Windows.Forms.FileDropTargetManager class and have successfully loaded dropped emails messages into an object using the Aspose.Email.MailMessage.Load() method.
To do this I first save the dropped mail message to file before calling the load method:
Dim output As System.IO.FileStream
output = New System.IO.FileStream(strFilename, System.IO.FileMode.CreateNew)
Dim objOutlookItem As Aspose.Email.MailMessage = Aspose.Email.MailMessage.Load(strFilename)
Whilst this also works with dropped Outlook calendar entries, the resultant MailMessage object doesn’t provide properties to access calendar entry information like location and attendees. If I save the MailMessage object to file after dragging a calendar entry into the application, it does however save all the outlook meeting information.
I looked at using the Aspose.Email.Calendar.Appointment.Load() method when dragging in Outlook calendar entries, but this always fails with the error:
“A first chance exception of type ‘Aspose.Email.AsposeInvalidDataException’ occurred in Aspose.Email.dll. Additional information: The data appears to be corrupted.”
So my question is, when dragging items from Outlook onto a FileDropTargetManager, how do I determine which dropped files are emails and which are meetings, and then how do I load the meetings into an object that allows me to interrogate the Outlook Meeting properties (i.e. location, attendees, start time, end time etc).
Hopefully that makes sense.
Any help is welcome.