Drag & Drop Outlook E-Mail in eine Form, und Informationen auslesen

  • VB.NET

Es gibt 6 Antworten in diesem Thema. Der letzte Beitrag () ist von ibot3.

    Drag & Drop Outlook E-Mail in eine Form, und Informationen auslesen

    Hallo,

    wie kann ich es ermöglichen, dass man eine Outlook E-Mail auf ein Label o.ä. zieht, und dann in Labels die Informationen der E-Mail abrufen (Absender, Betreff, Inhalt, etc.).

    Ich habe bereits viel gegoogelt, hab aber kein vernünftiges Ergebnis gefunden.



    LG ibot3
    Hast du dir mal ein Label erstellt und "AllowDrop" aktiviert?
    Anschließend kannst du dir im Debugging mal anschauen was so in dem Drop-Objekt steht.
    Dann weißt du vielleicht auch was du dir in dem Lable anzeigen musst.
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    Und was wird dir in dem Objekt angezeigt?
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    Wenn die AllowDrop erlaubst, kannst du etwas auf dieses Lable Dropen.
    Daher kannst du dir im DragEnter oder DragDrop Event des Lables auch anschauen WAS du da gedroppt hast.

    Entsprechend der Informationen die du dann bekommst kannst du die Entsprechenden Informationen anzeigen.
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."

    VB.NET-Quellcode

    1. Imports System.Runtime.InteropServices
    2. Imports Microsoft.Office.Interop
    3. Public Class Form1
    4. Dim objOL As New Outlook.ApplicationPrivate Sub Label1_DragDrop(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles Label1.DragDrop
    5. If e.Data.GetDataPresent("FileGroupDescriptor") Then
    6. Dim myobj As Object
    7. myobj = objOL.ActiveExplorer.Selection.Item(1)
    8. RichTextBox2.Text = myobj.Subject
    9. RichTextBox1.Text = myobj.Body
    10. RichTextBox3.Text = myobj.SenderName
    11. Label2.Text = myobj.ReceivedTime
    12. End If
    13. End SubPrivate Sub Label1_DragOver(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Label1.DragOver
    14. Dim objOL As New Outlook.Applicatione.Effect = DragDropEffects.Copy
    15. End Sub
    16. End Class