Freigeben über


MsoEnvelope-Objekt (Office)

Bietet Zugriff auf Funktionen, mit denen Sie Dokumente als E-Mail-Nachrichten direkt aus Microsoft Office-Anwendungen senden können.

HinwBemerkungeneise

Verwenden Sie die MailEnvelope-Eigenschaft des Document- , Chart- oder Worksheet-Objekts (je nach verwendeter Anwendung), um ein MsoEnvelope-Objekt zurückzugeben.

Beispiel

Im folgenden Beispiel wird das aktive Microsoft Word-Dokument als E-Mail-Nachricht an die E-Mail-Adresse gesendet, die Sie an die Unterroutine übergeben.

Sub SendMail(ByVal strRecipient As String) 
 
 'Use a With...End With block to reference the MsoEnvelope object. 
 With Application.ActiveDocument.MailEnvelope 
 
 'Add some introductory text before the body of the email. 
 .Introduction = "Please read this and send me your comments." 
 
 'Return a Microsoft Outlook MailItem object that 
 'you can use to send the document. 
 With .Item 
 
 'All of the mail item settings are saved with the document. 
 'When you add a recipient to the Recipients collection 
 'or change other properties, these settings persist. 
 .Recipients.Add strRecipient 
 .Subject = "Here is the document." 
 
 'The body of this message will be 
 'the content of the active document. 
 .Send 
 End With 
 End With 
End Sub

Siehe auch

Support und Feedback

Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.