AppointmentItem-Objekt (Outlook)AppointmentItem Object (Outlook)

Stellt eine Besprechung, einen einmaligen Termin oder einen periodischen Termin bzw. eine periodische Besprechung im Ordner „Calendar" dar.Represents a meeting, a one-time appointment, or a recurring appointment or meeting in the Calendar folder.

HinweiseRemarks

Verwenden Sie die CreateItem -Methode, um ein AppointmentItem -Objekt erstellen, das einen neuen Termin darstellt.Use the CreateItem method to create an AppointmentItem object that represents a new appointment.

Verwenden Sie Elemente ( Index ), wobei Index die Indexnummer eines Termins oder ein Wert, der der Standardeigenschaft eines Termins entspricht, um ein einzelnes AppointmentItem -Objekt aus einem Kalenderordner zurückzugeben.Use Items ( index ), where index is the index number of an appointment or a value used to match the default property of an appointment, to return a single AppointmentItem object from a Calendar folder.

Sie können auch ein AppointmentItem -Objekt aus einem MeetingItem -Objekt zurückgeben, über die GetAssociatedAppointment -Methode.You can also return an AppointmentItem object from a MeetingItem object by using the GetAssociatedAppointment method.

Wenn Sie mit Terminserien arbeiten, müssen Sie vorherige Verweise freigeben, neue Verweise auf das Terminserienelement abrufen, bevor Sie das Element öffnen oder bearbeiten, und diese Verweise freigeben, sobald Sie Ihre Änderungen abgeschlossen und gespeichert haben.When you work with recurring appointment items, you should release any prior references, obtain new references to the recurring appointment item before you access or modify the item, and release these references as soon as you are finished and have saved the changes. In dieser Methode wird auf die wiederkehrenden AppointmentItem -Objekt und Ausnahme oder RecurrencePattern -Objekt angewendet wird.This practice applies to the recurring AppointmentItem object, and any Exception or RecurrencePattern object. Um einen Verweis in Visual Basic for Applications (VBA) freizugeben, legen Sie dieses vorhandene Objekt auf Nichts fest.To release a reference in Visual Basic for Applications (VBA) or Visual Basic, set that existing object to Nothing. Geben Sie in C# den Arbeitsspeicher für dieses Objekt explizit frei.In C#, explicitly release the memory for that object.

Beachten Sie, dass selbst, nachdem Sie Ihre Referenz freigegeben haben und versuchen eine neue Referenz abzurufen, Ihre neue Referenz weiterhin auf eine veraltete Kopie des Objekts zeigt, wenn weiterhin eine aktive Referenz zu einem der obigen Objekte vorliegt, die von einem anderen Add-In oder von Outlook verwendet wird.Note that even after you release your reference and attempt to obtain a new reference, if there is still an active reference, held by another add-in or Outlook, to one of the above objects, your new reference will still point to an out-of-date copy of the object. Daher ist es wichtig, dass Sie Ihre Referenzen freigeben, sobald Sie mit dem periodischen Termin fertig sind.Therefore, it is important that you release your references as soon as you are finished with the recurring appointment.

Im folgenden Codebeispiel in VBA wird gezeigt, wie Referenzen freigegeben und aktualisiert werden, um aktuelle Daten für einen periodischen Termin abzurufen.The following code example in VBA shows how to release and refresh references in order to obtain up-to-date data for a recurring appointment. Im Beispiel wird ein Satz von Terminelementen aus dem Ordner „Calendar" abgerufen.The example obtains a set of appointment items from the Calendar folder. Es wird angenommen, dass das erste Element in der Terminsammlung ein Bestandteil des periodischen Termins ist.It assumes that the first item in the appointment collection is part of a recurring appointment. Im Beispiel wird gezeigt, dass eine Referenz zu einer Terminsammlung, die vor dem Erstellen einer Ausnahme abgerufen wird, die Ausnahme nicht widerspiegelt.The example shows that a reference to the appointment collection obtained before an exception is created does not reflect the exception. Im Beispiel wird diese Referenz anschließend neben anderen vorhandenen Terminreferenzen freigegeben, wonach neue Referenzen, die auf die Terminsammlung zeigen, die Ausnahme widerspiegeln.The example then releases this reference and other existing appointment references, after which new references that point to the appointment collection reflect the exception.

Sub TestExceptions() 
 
 Dim oItems As Items 
 
 Dim oItemOriginal As AppointmentItem 
 
 Dim oItemNew As AppointmentItem 
 
 Dim rPattern As RecurrencePattern 
 
 Dim oEx As Exceptions 
 
 Dim oEx2 As Exceptions 
 
 Dim oOccurrence As AppointmentItem 
 
 Dim i As Long 
 
 
 
 ' This is the initial reference to an appointment collection. 
 
 Set oItems = _ 
 
 Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items 
 
 
 
 ' This is the original reference to the first appointment in the 
 
 ' collection before an exception is created. 
 
 Set oItemOriginal = oItems.Item(1) 
 
 
 
 ' Code example assumes that the first appointment in the collection 
 
 ' is a recurring appointment. 
 
 Set oOccurrence = _ 
 
 oItemOriginal.GetRecurrencePattern().GetOccurrence(#2/28/2010 8:00:00 AM#) 
 
 
 
 ' Create an exception by changing the 2/28 occurrence to 3/3. 
 
 oOccurrence.Start = #3/3/2010 8:00:00 AM# 
 
 oOccurrence.Save 
 
 
 
 Stop 
 
 
 
 ' Preexisting reference to the first appointment in the collection 
 
 ' does not reflect the exception. 
 
 oItemOriginal.Save 
 
 Set oEx = oItemOriginal.GetRecurrencePattern().Exceptions 
 
 Debug.Print oItemOriginal.subject 
 
 Debug.Print " Original item exceptions: " & oEx.Count 
 
 
 
 ' Get a new reference based on the existing reference to the 
 
 ' appointment collection created before the exception. 
 
 ' The new reference does not reflect the exception. 
 
 Set oItemNew = oItems.Item(1) 
 
 oItemNew.Save 
 
 Set oEx2 = oItemNew.GetRecurrencePattern().Exceptions 
 
 Debug.Print " New item exceptions: " & oEx2.Count 
 
 
 
 ' Same: preexisting reference to the first appointment in the collection 
 
 ' does not reflect the exception. 
 
 Set oEx = oItemOriginal.GetRecurrencePattern().Exceptions 
 
 Debug.Print " Original item exceptions: " & oEx.Count 
 
 
 
 ' Release all existing references to appointment items, 
 
 ' including the appointment collection, an exception, occurrence, 
 
 ' or any other appointment. 
 
 Debug.Print "REFRESH ITEM COLLECTION" 
 
 Set oItems = Nothing 
 
 Set oItemNew = Nothing 
 
 Set oEx = Nothing 
 
 Set oEx2 = Nothing 
 
 Set oOccurrence = Nothing 
 
 Set oItemOriginal = Nothing 
 
 Set rPattern = Nothing 
 
 
 
 ' Get new references to appointment items, including the appointment 
 
 ' collection, individual appointments, and exceptions. 
 
 Set oItems = _ 
 
 Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items 
 
 Set oItemNew = oItems.Item(1) 
 
 
 
 ' If no other add-ins have the same recurring appointment open, 
 
 ' the new references reflect the current exception count. 
 
 Set oEx2 = oItemNew.GetRecurrencePattern().Exceptions 
 
 Debug.Print " New item exceptions: " & oEx2.Count 
 
 
 
 Debug.Print "RE-GET ORIGINAL" 
 
 Set oItemOriginal = oItems.Item(1) 
 
 Set oEx = oItemOriginal.GetRecurrencePattern().Exceptions 
 
 Debug.Print " Original item exceptions: " & oEx.Count 
 
End Sub

BeispielExample

Im folgenden Visual Basic for Applications-Beispiel (VBA) wird ein neuer Termin zurückgegeben.The following Visual Basic for Applications (VBA) example returns a new appointment.

Set myItem = Application.CreateItem(olAppointmentItem)

EreignisseEvents

NameName
AfterWriteAfterWrite
AttachmentAddAttachmentAdd
AttachmentReadAttachmentRead
AttachmentRemoveAttachmentRemove
BeforeAttachmentAddBeforeAttachmentAdd
BeforeAttachmentPreviewBeforeAttachmentPreview
BeforeAttachmentReadBeforeAttachmentRead
BeforeAttachmentSaveBeforeAttachmentSave
BeforeAttachmentWriteToTempFileBeforeAttachmentWriteToTempFile
BeforeAutoSaveBeforeAutoSave
BeforeCheckNamesBeforeCheckNames
BeforeDeleteBeforeDelete
BeforeReadBeforeRead
CloseClose
CustomActionCustomAction
CustomPropertyChangeCustomPropertyChange
ForwardForward
OpenOpen
PropertyChangePropertyChange
LesenRead
ReadCompleteReadComplete
AntwortReply
ReplyAllReplyAll
SendenSend
UnloadUnload
SchreibenWrite

MethodenMethods

NameName
ClearRecurrencePatternClearRecurrencePattern
CloseClose
CopyCopy
CopyToCopyTo
DeleteDelete
DisplayDisplay
ForwardAsVcalForwardAsVcal
GetConversationGetConversation
GetOrganizerGetOrganizer
GetRecurrencePatternGetRecurrencePattern
MoveMove
PrintOutPrintOut
RespondRespond
SaveSave
SaveAsSaveAs
SendenSend
ShowCategoriesDialogShowCategoriesDialog

EigenschaftenProperties

NameName
ActionsActions
AllDayEventAllDayEvent
ApplicationApplication
AttachmentsAttachments
AutoResolvedWinnerAutoResolvedWinner
BillingInformationBillingInformation
BodyBody
BusyStatusBusyStatus
CategoriesCategories
ClassClass
CompaniesCompanies
ConflictsConflicts
ConversationIDConversationID
ConversationIndexConversationIndex
ConversationTopicConversationTopic
CreationTimeCreationTime
DownloadStateDownloadState
DurationDuration
EndEnd
EndInEndTimeZoneEndInEndTimeZone
EndTimeZoneEndTimeZone
EndUTCEndUTC
EntryIDEntryID
ForceUpdateToAllAttendeesForceUpdateToAllAttendees
FormDescriptionFormDescription
GetInspectorGetInspector
GlobalAppointmentIDGlobalAppointmentID
ImportanceImportance
InternetCodepageInternetCodepage
IsConflictIsConflict
IsRecurringIsRecurring
ItemPropertiesItemProperties
LastModificationTimeLastModificationTime
LocationLocation
MarkForDownloadMarkForDownload
MeetingStatusMeetingStatus
MeetingWorkspaceURLMeetingWorkspaceURL
MessageClassMessageClass
MileageMileage
NoAgingNoAging
OptionalAttendeesOptionalAttendees
OrganizerOrganizer
OutlookInternalVersionOutlookInternalVersion
OutlookVersionOutlookVersion
ParentParent
PropertyAccessorPropertyAccessor
RecipientsRecipients
RecurrenceStateRecurrenceState
ReminderMinutesBeforeStartReminderMinutesBeforeStart
ReminderOverrideDefaultReminderOverrideDefault
ReminderPlaySoundReminderPlaySound
ReminderSetReminderSet
ReminderSoundFileReminderSoundFile
ReplyTimeReplyTime
RequiredAttendeesRequiredAttendees
RessourcenResources
ResponseRequestedResponseRequested
ResponseStatusResponseStatus
RTFBodyRTFBody
SavedSaved
SendUsingAccountSendUsingAccount
VertraulichkeitSensitivity
SessionSession
SizeSize
StartStart
StartInStartTimeZoneStartInStartTimeZone
StartTimeZoneStartTimeZone
StartUTCStartUTC
SubjectSubject
UngeleseneUnRead
UserPropertiesUserProperties

Siehe auchSee also

Outlook-Objektmodellreferenz Vorgehensweise: Importieren von Termin-XML-Daten in Outlook-Terminobjekte Elemente des AppointmentItem-ObjektsOutlook Object Model Reference How to: Import Appointment XML Data into Outlook Appointment Objects AppointmentItem Object Members