CustomAction Event

Applies To

AppointmentItem object, ContactItem object, JournalItem object, MailItem object, MeetingRequestItem object, NoteItem object, PostItem object, RemoteItem object, ReportItem object, TaskItem object, TaskRequestItem object.

Description

Occurs when a custom action of an Outlook item executes. Both the original item and the newly created item resulting from the custom action are passed to the event. If you set the return value of this function to False, the custom action is not completed.

Syntax

Function Item_CustomAction(Action As Object, Response As Object)

Action The custom action being executed.

Response The new item created in response to executing the custom action.

See Also

Close event, CustomPropertyChange event, Forward event, Open event, PropertyChange event, Read event, Reply event, ReplyAll event, Send event, Write event.

Example

This example sets a property on the response item.

Function Item_CustomAction(ByVal myAction, ByVal myResponse)
    Select Case myAction.Name
        Case "Action1"
            myResponse.Subject = "Changed by VBScript"
        Case Else
    End Select
End Function