次の方法で共有


Stores.BeforeStoreRemove Event (Outlook)

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

Version Information

Version Added: Outlook 2007

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.

You can 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

Concepts

Stores Object Members

Stores Object