Write 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 an Outlook item is saved, either explicitly (for example, using the Save or SaveAs method) or implicitly (for example, in response to a prompt when closing the item's inspector). If you set the return value of this function to False, the save operation isn't completed.

Syntax

Function Item_Write( )

See Also

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

Example

This example warns the user that item is about to be saved and will overwrite any existing item and, depending on the user's response, either allows the operation to continue or stops it.

Function Item_Write()
    myResult = MsgBox ("The item is about to be saved. Do you wish " _
        & "to overwrite the existing item?", 289, "Save")
    If myResult = 1 Then
        Item_Write = True
    Else
        Item_Write = False
    End If
End Function