Partager via


StoresEvents_12_Event.BeforeStoreRemove Event

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

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
Event BeforeStoreRemove As StoresEvents_12_BeforeStoreRemoveEventHandler
'Usage
Dim instance As StoresEvents_12_Event
Dim handler As StoresEvents_12_BeforeStoreRemoveEventHandler

AddHandler instance.BeforeStoreRemove, handler
event StoresEvents_12_BeforeStoreRemoveEventHandler BeforeStoreRemove

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

Reference

StoresEvents_12_Event Interface

StoresEvents_12_Event Members

Microsoft.Office.Interop.Outlook Namespace

Microsoft.Office.Interop.Outlook.StoresEvents_12_BeforeStoreRemoveEventHandler