Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MailItem.Read Event (Outlook)

Occurs when an instance of the parent object is opened for editing by the user.

expression .Read

expression A variable that represents a MailItem object.

The Read event differs from the Open event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an Inspector.

This Visual Basic for Applications (VBA) example uses the Read event to increment a counter that tracks how often an item is read.

Public WithEvents myItem As Outlook.MailItem 
Sub Initialize_handler() 
 Set myItem = Application.ActiveExplorer.CurrentFolder.Items(1) 
End Sub 
Sub myItem_Read() 
 Dim myProperty As Outlook.UserProperty 
 Set myProperty = myItem.UserProperties("ReadCount") 
 If (myProperty Is Nothing) Then 
 Set myProperty = myItem.UserProperties.Add("ReadCount", olNumber) 
 End If 
 myProperty.Value = myProperty.Value + 1 
End Sub
© 2015 Microsoft