![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I need to programmatically delete a particular occurrence in a
recurring pattern of appointments or tasks in an Outlook 2003 calendar. I have been using GetOccurrence to try to instantiate the occurrence, but I just cannot make it work. Example code: Set olTask = gOlNameSpace.GetItemFromID(strEntryID, strStoreID) .... Set olRecurrence = olTask.GetRecurrencePattern itemDate=#2/5/2006# Set olItem = olRecurrence.GetOccurrence(itemDate) olItem.Delete I get the recurrence pattern absolutely fine but when I use the GetOccurrence method I always get an automation error: -2147467259 "You changed one of the recurrences of this item, and this instance no longer exists, Close any open items and try again" I have tried many different ways of doing this, on patterns created programmatically and on patterns created manually in the Outlook client. The instances do exist because they can be viewed in the Outlook client window. The error occurs whenever a correctly formatted date is submitted to GetOccurrence, whether or not an occurrence should exist for that date. Have I missed something or is there a problem with this method? Andrew Chester |
Ads |
#3
|
|||
|
|||
![]()
Thank you Michael - this worked!
Michael Bauer [MVP - Outlook] wrote: Andrew, you must pass the date and time. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am 29 Nov 2006 09:26:54 -0800 schrieb : I need to programmatically delete a particular occurrence in a recurring pattern of appointments or tasks in an Outlook 2003 calendar. I have been using GetOccurrence to try to instantiate the occurrence, but I just cannot make it work. Example code: Set olTask = gOlNameSpace.GetItemFromID(strEntryID, strStoreID) ... Set olRecurrence = olTask.GetRecurrencePattern itemDate=#2/5/2006# Set olItem = olRecurrence.GetOccurrence(itemDate) olItem.Delete I get the recurrence pattern absolutely fine but when I use the GetOccurrence method I always get an automation error: -2147467259 "You changed one of the recurrences of this item, and this instance no longer exists, Close any open items and try again" I have tried many different ways of doing this, on patterns created programmatically and on patterns created manually in the Outlook client. The instances do exist because they can be viewed in the Outlook client window. The error occurs whenever a correctly formatted date is submitted to GetOccurrence, whether or not an occurrence should exist for that date. Have I missed something or is there a problem with this method? Andrew Chester |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2003 recurring meeting, recurring item tab not opening | [email protected] | Outlook - Calandaring | 0 | November 21st 06 06:18 PM |
Recurring item based on another recurring item | Bill Bradley | Outlook - Calandaring | 0 | November 15th 06 12:33 AM |
How to change an item from a recurring Appointment item to an exception from VB code? | Dikbill | Outlook and VBA | 2 | July 13th 06 09:45 AM |
Saving exception item in recurring appointment item fails | Dikbill | Outlook and VBA | 2 | July 11th 06 04:59 PM |
Saving exception item in recurring appointment item fails | Dikbill | Outlook - Calandaring | 0 | July 11th 06 03:01 PM |