共用方式為


Exception Object

Exceptions
Exception
Multiple objects

The Exception object holds information about one instance of an AppointmentItem object which is an exception to a recurring series. Unlike most of the other Microsoft Outlook objects, the Exception object is a read-only object. This means that you cannot create an Exception object but, rather, the object is created when a property of an AppointmentItem is altered. For example, if you change the Start property of one AppointmentItem, you have created an Exception in AppointmentItem.RecurrencePattern.Exceptions.

Note  The Exceptions object is on the RecurrencePattern , not the AppointmentItem object itself.

Using the Exception Object

The Exception object can be accessed from the RecurrencePattern object through the Exceptions object.

In Visual Basic for Applications (VBA):

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderCalendar)
Set myItems = myFolder.Items
Set myApptItem = myItems("Daily Meeting")
Set myRecurrencePattern = myApptItem.GetRecurrencePattern
Set myException = myRecurrencePattern.Exceptions.Item(1)

In Microsoft Visual Basic Scripting Edition (VBScript):

Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(9)
Set myItems = myFolder.Items
Set myApptItem = myItems("Daily Meeting")
Set myRecurrencePattern = myApptItem.GetRecurrencePattern
Set myException = myRecurrencePattern.Exceptions.Item(1)

Properties | Application Property | AppointmentItem Property | Class Property | Deleted Property | ItemProperties Property | OriginalDate Property | Parent Property | Session Property

Parent Objects

Child Objects | AppointmentItem Object | ItemProperties Object

See Also | Exceptions Property | GetAssociatedAppointment Method | GetRecurrencePattern Method | IncludeRecurrences Property | RecurrencePattern Object | RecurrenceState Property | RecurrenceType Property