Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / November 2006

Tip: Looking for answers? Try searching our database.

Unable to retrieve recurring item using GetOccurrence method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
achester@iken.biz - 29 Nov 2006 17:26 GMT
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
Michael Bauer [MVP - Outlook] - 30 Nov 2006 06:14 GMT
Andrew, you must pass the date and time.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 -- www.VBOffice.net --

Am 29 Nov 2006 09:26:54 -0800 schrieb achester@iken.biz:

> I need to programmatically delete a particular occurrence in a
> recurring pattern of appointments or tasks in an Outlook 2003 calendar.
[quoted text clipped - 30 lines]
>
> Andrew Chester
achester@iken.biz - 30 Nov 2006 09:32 GMT
Thank you Michael - this worked!

> Andrew, you must pass the date and time.
>
[quoted text clipped - 39 lines]
> >
> > Andrew Chester
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.