Frage

ich mit wenigen Ausnahmen eine Reihe in Outlook haben. Was würde Ich mag zu tun ist, alle Ausnahmen von dieser Serie zu entfernen. Weiß jemand, ob es eine Möglichkeit, dies zu tun ist? Da die Ausnahmeliste ist schreibgeschützt habe ich versucht, das Wiederholungsmuster Clearing- und alle Werte sans die Ausnahmeliste wie diese erneute Anwendung:

Dim tRType As OlRecurrenceType
Dim tRPSD As Date
Dim tRPED As Date
Dim tST As Date
Dim tET As Date
Dim tOcc As Integer
Dim tInterval As Integer

tRType = oAppointmentItem.GetRecurrencePattern.RecurrenceType
tRPSD = oAppointmentItem.GetRecurrencePattern.PatternStartDate
tRPED = oAppointmentItem.GetRecurrencePattern.PatternEndDate
tST = oAppointmentItem.GetRecurrencePattern.startTime
tET = oAppointmentItem.GetRecurrencePattern.endTime
tOcc = oAppointmentItem.GetRecurrencePattern.Occurrences
tInterval = oAppointmentItem.GetRecurrencePattern.Interval

oAppointmentItem.ClearRecurrencePattern
' This save throws an error. 
'oAppointmentItem.Save

' Make this call to flip to reccurring...
oAppointmentItem.GetRecurrencePattern
oAppointmentItem.GetRecurrencePattern.RecurrenceType = tRType
oAppointmentItem.GetRecurrencePattern.PatternStartDate = tRPSD
oAppointmentItem.GetRecurrencePattern.PatternEndDate = tRPED
oAppointmentItem.GetRecurrencePattern.startTime = tST
oAppointmentItem.GetRecurrencePattern.endTime = tET
oAppointmentItem.GetRecurrencePattern.Occurrences = tOcc
oAppointmentItem.GetRecurrencePattern.Interval = tInterval

So weit ich habe kein Glück mit diesem Ansatz. Nach Aufruf ClearRecurrencePattern alle Daten können nicht aktualisiert werden (oder nicht sowieso bestehen bleiben), weshalb ich das Speichern versucht, aber es funktioniert nicht. Es hat einen besseren Weg zu sein, und ich bin fehlt es einfach.

habe ich auch gedacht, eine vollständige Kopie des Termins zu tun und dann löschen / re-add aber möchte ich vermeiden möchte, dass, wenn überhaupt möglich.

War es hilfreich?

Lösung

I found the answer and will post it here in case anyone needs it. You can modify the patternendtime (and I am assuming start time) to cause it to clear the exceptions list. The code below causes all exceptions to be removed from the series.

Dim tEndDate As Date
Dim currentEndDate As Date
Dim dateInterval As Double
currentEndDate = oAppointmentItem.GetRecurrencePattern.PatternEndDate
tEndDate = oAppointmentItem.GetRecurrencePattern.PatternEndDate
' Add a year to the end date so we can force the exceptions to remove.
DateAdd "yyyy", 1, tEndDate
oAppointmentItem.GetRecurrencePattern.PatternEndDate = tEndDate
oAppointmentItem.GetRecurrencePattern.PatternEndDate = currentEndDate
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top