Skip to content

Latest commit

 

History

History
62 lines (32 loc) · 1.72 KB

Outlook.Explorer.SelectionChange.md

File metadata and controls

62 lines (32 loc) · 1.72 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Explorer.SelectionChange event (Outlook)
vbaol11.chm455
vbaol11.chm455
Outlook.Explorer.SelectionChange
ef0d976f-b9f6-2080-7657-e48d1c64ccb1
06/08/2017
medium

Explorer.SelectionChange event (Outlook)

Occurs when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface.

Syntax

expression. SelectionChange

expression A variable that represents an 'Explorer' object.

Remarks

This event also occurs when the user (either programmatically or via the user interface) clicks or switches to a different folder that contains items, because Outlook automatically selects the first item in that folder. However, this event does not occur if the folder is a file-system folder or if any folder with a current Web view is displayed. This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

Example

The following Microsoft Visual Basic for Applications (VBA) example displays the number of items that are selected in the active explorer window whenever the selection changes. The sample code must be placed in a class module, and the Initialize_handler routine must be called before the event procedure can be called by Microsoft Outlook.

Public WithEvents myOlExp As Outlook.Explorer 
 
 
 
Public Sub Initialize_handler() 
 
 Set myOlExp = Application.ActiveExplorer 
 
End Sub 
 
 
 
Private Sub myOlExp_SelectionChange() 
 
 MsgBox myOlExp.Selection.Count & " items selected." 
 
End Sub

See also

Explorer Object

[!includeSupport and feedback]