ドキュメントをメール メッセージとして 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 のサポートおよびフィードバックを参照してください。