Condividi tramite


Reply Event

Occurs when the user selects the Reply action for a Microsoft Outlook item.

Subobject**_Reply(ByVal Response As Object, Cancel As Boolean)**

*object   * An expression that evaluates to one of the objects in the Applies To list. In VBScript, use the word Item.

*Response   * The new item being sent in response to the original message.

*Cancel   * Optional (not used in VBScript). False when the event occurs. If the event procedure sets this argument to True, the reply operation is not completed and the new item is not displayed.

Remarks

In Microsoft Visual Basic Scripting Edition (VBScript), if you set the return value of this function to False, the reply action is not completed and the new item is not displayed.

Example

This Visual Basic for Applications (VBA) example uses the Reply event and sets the Sent Items folder for the reply item to the folder in which the original item resides. To use this example, open an existing mailitem, run the Initialize Handler() procedure, then reply to the open item.

Public WithEvents myItem As MailItem

Sub Initialize_Handler()
    Set myItem = Application.ActiveInspector.CurrentItem
End Sub

Private Sub myItem_Reply(ByVal Response As Object, Cancel As Boolean)
    Set Response.SaveSentMessageFolder = myItem.Parent
End Sub

Applies to | AppointmentItem Object | ContactItem Object | DistListItem Object | DocumentItem Object | JournalItem Object | MailItem Object | MeetingItem Object | PostItem Object | RemoteItem Object | ReportItem Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object

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