OnSave Method

Topic Last Modified: 2006-06-13

Called by a store when an item is saved.

Applies To

IExStoreAsyncEvents Interface

Type Library

EXOLEDB Type Library

DLL Implemented In

EXOLEDB.DLL

Syntax

Sub OnSave(    ByVal pEventInfo As IExStoreEventInfo,
        ByVal bstrURLItem As String,
        ByVal IFlags As LONG)
HRESULT OnSave
(
        IExStoreEventInfo* pEventInfo,
        BSTR bstrURLItem,
        LONG IFlags
);

Parameters

  • bstrURLItem
    A string containing a URL to the new saved item.
  • IFlags
    The following (bitwise AND) flags can give you additional information about the save event:

    Decimal Value C++ Enum Equivalent Meaning

    1

    EVT_NEW_ITEM

    The item being saved is new.

    2

    EVT_IS_COLLECTION

    The item being saved is a collection.

    4

    EVT_REPLICATED_ITEM

    The item is being saved as a result of replication.

    8

    EVT_IS_DELIVERED

    The item is being saved as the result of message delivery.

    64

    EVT_INITNEW

    This flag is set at the first firing of the event. (This is useful for initialization purposes. It is set only once during the lifetime of a created event sink.)

    256

    EVT_MOVE

    The item was moved, resulting in an implicit save.

    512

    EVT_COPY

    The item was copied, resulting in an implicit save.

Return Value

Returns S_OK if successful, or an error value otherwise.

Registration Properties

To register for this event, you need to set the registration item's EventMethod Field property to "OnSave" (C++ constant = EVT_ON_SAVE).

This event supports the following properties of Event Registration Items:

Criteria Field

Enabled Field

EventMethod Field

MatchScope Field

ScriptUrl Field

SinkClass Field

Remarks

This event is fired when a new item enters the store, when an existing item is saved, and when an item is moved or copied. This event does not fire when the item's parent folder is moved or copied.

See the IAsyncNotify Interface for information about processing asynchronous events in a Component Object Model (COM) object.