'How can I reset recurring meeting in vba?
I wrote vba script to duplication my main calendar to another calendar, including recurring meeting. All is well except when the organizer do out-of-order modifications to the recurring meeting as meeting exceptions. This triggers error for .GetOccurrence(). The solution I can think of is to reset the recurrence pattern (.Exceptions.Count=0) and redo each and every exceptions again. May I know how can I reset the recurrence pattern so that there is no exception?
Thanks!
Solution 1:[1]
May I know how can I reset the recurrence pattern so that there is no exception?
The Outlook object model doesn't provide any method or property for that. You need to re-create an appointment anew and set up a recurrence pattern.
Solution 2:[2]
Many thanks for the reply. I re-work my program to avoid the need to reset the recurrence pattern. The key realization for me is the function of Original Date
. This is the "key" that link my main calendar and my duplicated calendar. I need to loop through all the exception to find the appointment that matched based on original date. With that, I can then use exception(i).start
as the key to GetOccurrence()
.
Solution 3:[3]
If you are getting an error in the GetOccurrence()
method, that means you are not passing the right date - you need to trap the exception and use the RecurrencePattern.Exceptions
collection instead.
If you still want to reset the pattern and using Redemption (I am its author) is an option for you, it exposes RDOExceptions.Clear
method to remove all exceptions from an appointment as well as RDOExceptions.Restore
to remove a particular exception
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eugene Astafiev |
Solution 2 | Leon |
Solution 3 |