Removing Series Exceptions

I have a series in Outlook with a few exceptions. I would like to remove all exceptions from this series. Does anyone know if there is a way to do this? Since the exception list is read-only, I tried to clear the recurrence pattern and reapply all the values ​​without the exception list, for example:

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 far I have been unlucky with this approach. After calling ClearRecurrencePattern, all the data cannot be updated (or will not be saved in any case), so I tried to save, but this will not work. There must be a better way, and I'll just skip it.

I also thought about making a full copy of the destination and then deleting / re-adding, but I would like to avoid this, if at all possible.

+4
source share
1 answer

I found the answer and posted it here if someone needs it. You can change the template time (and I guess the start time) so that it clears the exception list. In the code below, all exceptions are excluded 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 
+1
source

Source: https://habr.com/ru/post/1334990/


All Articles