Stores.BeforeStoreRemove event (Outlook)

Occurs when a Store is about to be removed from the current session either programmatically or through user action.

Syntax

expression. BeforeStoreRemove( _Store_ , _Cancel_ )

expression A variable that represents a Stores object.

Parameters

Name Required/Optional Data type Description
Store Required Store The Store object to be removed from the current session.
Cancel Required Boolean True to cancel the removal of the specified store, False otherwise.

Remarks

Outlook must be running in order for this event to fire. This event will fire when any of the following occurs:

  • A store is removed by the user clicking the Close command on the Shortcut menu.

  • A store is removed programmatically by calling Namespace.RemoveStore.

This event will not fire when any of the following occurs:

  • When Outlook shuts down and closes a primary or delegate store.

  • If a store is removed through the Mail applet in the Microsoft Windows Control Panel and Outlook is not running.

  • A delegate store is removed on the Advanced tab of the Microsoft Exchange Server dialog box.

  • A store is removed through the Data Files tab of the Account Manager dialog box when Outlook is not running.

  • An IMAP Store is removed from the profile.

Use this event to determine that a store has been removed, and take appropriate actions if the store is required for your application (such as remounting the store). Otherwise you would have to resort to polling the Stores collection.

See also

Stores Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.