共用方式為


Send Method

Sends the appointment, meeting item, e-mail message, or task.

expression**.Send**

*expression   * Required. An expression that returns an AppointmentItem, MeetingItem, MailItem, or TaskItem object.

Remarks

When you run a program that uses the Microsoft Outlook object model to call the Send method, you receive a warning message. This warning message tells you that a program is trying to send a message on your behalf and asks if you want to allow the message to be sent. The warning message contains both a Yes and a No button. However, the Yes button is not available until five seconds have passed since the warning message appeared. You can dismiss the warning message immediately if you click No.

Example

This Visual Basic for Applications (VBA) example uses CreateItem to create a simple task and delegate it as a task request to another user. Replace 'Dan Wilson' with a valid recipient name before running this example.

Sub AssignTask()
    Dim myOlApp As New Outlook.Application
    Dim myItem As Outlook.TaskItem
    Dim myDelegate As Outlook.Recipient
    Set MyItem = myOlApp.CreateItem(olTaskItem)
    MyItem.Assign
    Set myDelegate = MyItem.Recipients.Add("Dan Wilson")
    myDelegate.Resolve
    If myDelegate.Resolved Then
        myItem.Subject = "Prepare Agenda for Meeting"
        myItem.DueDate = Now + 30
        myItem.Display
        myItem.Send
    End If
End Sub

If you use Microsoft Visual Basic Scripting Edition (VBScript) in an Outlook form, you do not create the Application object, and you cannot use named constants. This example shows how to forward a mail item using VBScript code.

Sub CommandButton1_Click()
 Set myNameSpace = Application.GetNameSpace("MAPI")
 Set myFolder = myNameSpace.GetDefaultFolder(6)
 Set myForward = myFolder.Items(1).Forward
 myForward.Recipients.Add "Laura Jennings"
 myForward.Send
End Sub

Applies to | AppointmentItem Object | MailItem Object | MeetingItem Object | TaskItem Object

See Also | Close Method | CustomAction Event | CustomPropertyChange Event | Forward Event | Open Event | PropertyChange Event | Read Event | Reply Event | ReplyAll Event | Sent Property | Using events with Automation | Write Event