PropertyChange Event

Microsoft Outlook Visual Basic

Show All

PropertyChange Event

       

Occurs when a standard property (for example, Subject or To) of a Microsoft Outlook item is changed. The property name is passed to the event so that you can determine which property was changed.

Sub object_PropertyChange(ByVal Name As String)

object   One of the objects in the Applies To list. In VBScript, use the word Item.

Name   Required. The name of the property that was changed.

Example

This example uses the PropertyChange event to disable the setting of a reminder on an item.

Sub Item_PropertyChange(ByVal myPropertyName)
    Select Case myPropertyName
        Case "ReminderSet"
            MsgBox "You may not set a reminder on this item!"
            Item.ReminderSet = False
        Case Else
    End Select
End Sub