Referencing Microsoft.Office.Interop.Outlook.dll
, this is a very simple and straightforward method, no third party code, to get a dropped item from Outlook info:
Imports Microsoft.Office.Interop
.....
Private Sub MainForm_DragEnter(sender As Object, e As DragEventArgs) Handles Me.DragEnter, TextBox1.DragEnter
DragStart = True
End Sub
Private Sub MainForm_DragOver(sender As Object, e As DragEventArgs) Handles Me.DragOver, TextBox1.DragOver
If DragStart Then
If e.Data.GetFormats.Contains("Csv") OrElse e.Data.GetFormats.Contains("CSV") Then
e.Effect = DragDropEffects.Copy
End If
End If
DragStart = False
End Sub
Private Sub GetFromOutlook()
Dim myOlApp As New Outlook.Application
Dim myExp As Outlook.Explorer = myOlApp.ActiveExplorer
Dim myMailItem As Outlook.MailItem = DirectCast(myExp.Selection.Item(1), Outlook.MailItem)
' (with debug) you can check other properties
'For Each ipp As Outlook.ItemProperty In myMailItem.ItemProperties
' Dim x1 = ipp.Name
' Dim x2 = ipp.Value
'Next
Const PR_TRANSPORT_MESSAGE_HEADERS = "http://schemas.microsoft.com/mapi/proptag/0x007D001F"
Const PR_MAIL_HEADER_TAG = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
Dim oPA As Outlook.PropertyAccessor = myMailItem.PropertyAccessor 'As Outlook.PropertyAccessor
Dim Header As String = oPA.GetProperty(PR_MAIL_HEADER_TAG)
Dim messageBody = myMailItem.Body
myExp = Nothing
myMailItem = Nothing
myOlApp = Nothing
'
' ......enter your code here
'
End Sub