Hello all,
I have a recurring appointment, Thursday every other week there's cleaning aid ;-)
Once an instance of the series has passed, I would like to change the start date of the recurring pattern to start 2 weeks later.
As in: I want to clear older occurences of the pattern and 'start' 2 weeks later, everytime.
I found a similar thread but no replies there: Appointment Delete/Change Recurrence
The code below works until the .Save command. There I get the error:
Also, visually in my calendar, I don't see the pattern shifting to 2 weeks later.
What am I missing please ?
I have a recurring appointment, Thursday every other week there's cleaning aid ;-)
Once an instance of the series has passed, I would like to change the start date of the recurring pattern to start 2 weeks later.
As in: I want to clear older occurences of the pattern and 'start' 2 weeks later, everytime.
I found a similar thread but no replies there: Appointment Delete/Change Recurrence
The code below works until the .Save command. There I get the error:
Code:
Sub Clear_Thuishulp_Instance()
Dim objSelection As Outlook.Selection
Dim objAppointment As Outlook.AppointmentItem
Dim o As Outlook.AppointmentItem
Set objSelection = Outlook.Application.ActiveExplorer.Selection
If Not (objSelection Is Nothing) Then
For Each objAppointment In objSelection
If objAppointment.Class = 26 Then '26 = olAppointment
If objAppointment.IsRecurring Then
If objAppointment.Subject = "Thuishulp" Then
Set o = objAppointment
Exit For
End If
End If
End If
Next
End If
If o Is Nothing Then
MsgBox "Recurring 'Thuishulp' appointment not found. Please select it first."
Exit Sub
End If
With o
.GetRecurrencePattern.PatternStartDate = .GetRecurrencePattern.PatternStartDate + 14
.Save
End With
End Sub
Also, visually in my calendar, I don't see the pattern shifting to 2 weeks later.
What am I missing please ?