Freigeben über


Gewusst wie: Erstellen eines E-Mail-Elements

Aktualisiert: November 2007

Betrifft

Die Informationen in diesem Thema gelten nur für die angegebenen Visual Studio Tools for Office-Projekte und Versionen von Microsoft Office.

Projekttyp

  • Projekte auf Anwendungsebene

Microsoft Office-Version

  • Outlook 2003

  • Outlook 2007

Weitere Informationen hierzu finden Sie unter Verfügbare Features nach Anwendung und Projekttyp.

In diesem Beispiel wird eine E-Mail-Nachricht in Microsoft Office Outlook erstellt.

Beispiel

Private Sub CreateMailItem()
    Dim mailItem As Outlook.MailItem = _
        Me.Application.CreateItem(Outlook.OlItemType.olMailItem)
    mailItem.Subject = "This is the subject"
    mailItem.To = "someone@example.com"
    mailItem.Body = "This is the message."
    mailItem.Importance = Outlook.OlImportance.olImportanceLow
    mailItem.Display(False)
End Sub
private void CreateMailItem()
{
    Outlook.MailItem mailItem = (Outlook.MailItem)
        this.Application.CreateItem(Outlook.OlItemType.olMailItem);
    mailItem.Subject = "This is the subject";
    mailItem.To = "someone@example.com";
    mailItem.Body = "This is the message.";
    mailItem.Importance = Outlook.OlImportance.olImportanceLow;
    mailItem.Display(false);
}

Siehe auch

Konzepte

Arbeiten mit E-Mail-Elementen

Erste Schritte beim Programmieren von Add-Ins auf Anwendungsebene