Office) (MsoEnvelope 物件
提供功能的存取權,可讓您直接從 Microsoft Office 應用程式傳送檔作為電子郵件訊息。
註解
根據您使用) 傳回 MsoEnvelope 物件的應用程式, (使用 Document 物件、 Chart 物件或 Worksheet 物件的 MailEnvelope 屬性。
範例
下列範例會將使用中的 Microsoft Word 檔當做電子郵件訊息傳送至您傳遞至副程式的電子郵件地址。
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
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。