IMAPIOffline::SetCurrentState

Applies to: Outlook 2013 | Outlook 2016

Sets the current state of an offline object to online or offline.

HRESULT SetCurrentState( 
    ULONG ulFlags, 
    ULONG ulMask, 
    ULONG ulState, 
    void* pReserved 
);

Parameters

ulFlags

[in] Modifies the behavior of this call. The supported values are:

MAPIOFFLINE_FLAG_BLOCK

Setting ulFlags to this value will block the SetCurrentState call until the state change is complete. By default the transition takes place asynchronously. When the transition is occurring asynchronously, all SetCurrentState calls will return E_PENDING until the change is complete.

MAPIOFFLINE_FLAG_DEFAULT

Sets the current state without blocking.

ulMask

[in] The part of the state to change. The only supported value is MAPIOFFLINE_STATE_OFFLINE_MASK.

ulState

[in] The state to change to. It must be one of these two values:

MAPIOFFLINE_STATE_ONLINE

MAPIOFFLINE_STATE_OFFLINE

pReserved

This parameter is reserved for Outlook internal use and is not supported.

Return value

S_OK

The state of the offline object has been changed successfully.

E_PENDING

This indicates that the state of the offline object is changing asynchronously. This occurs when ulFlags is set to MAPIOFFLINE_FLAG_BLOCK in an earlier SetCurrentState call, and any subsequent SetCurrentState call will return this value until the asynchronous state change is complete.

See also

IMAPIOffline::GetCapabilities
IMAPIOffline::GetCurrentState MAPI Constants