Workbook.SendMail Method (2007 System)
Sends the workbook by using the installed mail system.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
Public Sub SendMail ( _
Recipients As Object, _
Subject As Object, _
ReturnReceipt As Object _
)
'Usage
Dim instance As Workbook
Dim Recipients As Object
Dim Subject As Object
Dim ReturnReceipt As Object
instance.SendMail(Recipients, Subject, _
ReturnReceipt)
public void SendMail(
Object Recipients,
Object Subject,
Object ReturnReceipt
)
public:
void SendMail(
Object^ Recipients,
Object^ Subject,
Object^ ReturnReceipt
)
public function SendMail(
Recipients : Object,
Subject : Object,
ReturnReceipt : Object
)
Parameters
Recipients
Type: System.ObjectSpecifies the name of the recipient as text, or as an array of text strings if there are multiple recipients. At least one recipient must be specified, and all recipients are added as To recipients.
Subject
Type: System.ObjectSpecifies the subject of the message. If this argument is omitted, the document name is used.
ReturnReceipt
Type: System.Objecttrue to request a return receipt. false to not request a return receipt. The default value is false.
Remarks
Optional Parameters
For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.
Examples
The following code example uses the SendMail method to send the workbook in an e-mail to a single recipient. The e-mail will have the subject "Please review" and will not request a return receipt.
This example is for a document-level customization.
Private Sub WorkbookSendMail()
Me.SendMail("someone@example.com", "Please review", False)
End Sub
private void WorkbookSendMail()
{
this.SendMail("someone@example.com", "Please review this proposal.", false);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.