Office) (MsoEnvelope.Item 屬性
取得 MailItem 物件,可用來以電子郵件傳送檔。 唯讀。
語法
運算式。專案
需要 expression。 代表 MsoEnvelope 物件的 變數。
範例
下列範例會將使用中的 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 message.
.Introduction = "Please read this and send me your comments."
'Return a 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 will 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 支援與意見反應。