After some researching I got a working sample using outlook automation, you
need a reference to the outlook object library for it to work. It check's to
see if the "Object Descriptor" contains outlook, the it opens an
outlookapplication class and get's the active explorer selected message,
from this the message body is retrieved.
Hope this helps
Private Sub RichTextBox1_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles RichTextBox1.DragEnter
If e.Data.GetDataPresent("Object Descriptor") Then
e.Effect = DragDropEffects.Copy
'(0): "RenPrivateSourceFolder"
'(1): "RenPrivateMessages"
'(2): "FileGroupDescriptor"
'(3): "FileContents"
'(4): "Object Descriptor"
'(5): "System.String"
'(6): "UnicodeText"
'(7): "Text"
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub RichTextBox1_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles RichTextBox1.DragDrop
If (e.Data.GetDataPresent("Object Descriptor")) Then
Dim myMem As New MemoryStream
Dim myByte As Byte()
Dim strCheck As String
myMem = DirectCast(e.Data.GetData("Object Descriptor"),
MemoryStream)
myByte = myMem.ToArray
myMem.Close()
For i As Integer = 0 To myByte.Length - 1
If myByte(i) <> 0 Then
strCheck &= Convert.ToChar(myByte(i))
End If
Next
If LCase(strCheck).IndexOf("outlook") > -1 Then
Dim myOlApp As New Outlook.ApplicationClass
Dim myExp As Outlook.Explorer = myOlApp.ActiveExplorer
Dim myMailItem As Outlook.MailItem
myMailItem = DirectCast(myExp.Selection.Item(1),
Outlook.MailItem)
RichTextBox1.Text = myMailItem.Body
myExp = Nothing
myMailItem = Nothing
myOlApp = Nothing
End If
End If
End Sub