Condividi tramite


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.

Subobject**_PropertyChange(ByVal Name As String)**

*object   * One of the objects in the Applies To list. In Microsoft Visual Basic Scripting Edition (VBScript), use the word Item.

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

Example

This Visual Basic for Applications (VBA) example uses the PropertyChange event to prevent someone from disabling a reminder on an item.

Public WithEvents myItem As Outlook.AppointmentItem

Sub Initialize_handler()
    Set myItem = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items("Status Meeting")
End Sub

Private Sub myItem_PropertyChange(ByVal Name As String)
    Select Case Name
    Case "ReminderSet"
        MsgBox "You may not remove a reminder on this item."
        myItem.ReminderSet = True
    Case Else
    End Select
End Sub

Applies to | AppointmentItem Object | ContactItem Object | DistListItem Object | DocumentItem Object | JournalItem Object | MailItem Object | MeetingItem Object | PostItem Object | RemoteItem Object | ReportItem Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object

See Also | Close Method | CustomAction Event | CustomPropertyChange Event | Forward Event | Open Event | Read Event | Reply Event | ReplyAll Event | Send Method | Using events with Automation | Write Event