The SelectionChange event answers many requests from Outlook developers for a means to determine which items are currently selected in the Explorer. The SelectionChange event occurs when the selection changes in the current view in the active Explorer window. Be aware that this event does not fire if you iterate over a collection of items in the current folder programmatically. The event is not triggered if the current folder in the Explorer changes due to a user action or code. However, if the user then changes the selection with a mouse click or an arrow key after he changes folders, the SelectionChange event occurs. When the SelectionChange event fires, use the Selection Property object of the Explorer object to return the items that are selected. The following example tests theSelection object to determine whether Contact items are selected and then displays the number of selected contacts in a message box:
Was this article helpful?