Help!

RecurrencePattern.GetOccurrence() fails on patterns from r..

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  how to redirect a an email to a specic folder  
Author Message
Jeff
External


Since: Apr 20, 2007
Posts: 11



PostPosted: Thu Oct 15, 2009 7:55 am    Post subject: RecurrencePattern.GetOccurrence() fails on patterns from recurring
Archived from groups: microsoft>public>outlook>program_vba (more info?)

I'm getting a

"Member not found. (Exception from HRESULT: 0x80020003
(DISP_E_MEMBERNOTFOUND))"

error when I try to get a particular occurrence of a recurring task.

The MSDN documentation implies that you can get an particular
occurrence of an appointment or task using the following technique
(expressed here is pseudocode):

Item recurringItem = NameSpace.GetItemFromId(entryId,storeId);
RecurrencePattern pattern = recurringItem.GetRecurrencePattern();
Item occurrence = pattern.GetOccurrence(date);

That approach works correctly w/ recurring appointments,
however, .GetOccurrence() fails when the item is a task.

I'm sure that there is a recurring task on 'date', b/c I can see the
task in Outlook. I'm aware of the fact that GetOccurrence() will throw
an exception if there is no occurrence on that date; that's not the
issue I'm having.

Thanks in advance.

jb
Back to top
Sue Mosher [MVP]
External


Since: Oct 15, 2009
Posts: 13



PostPosted: Thu Oct 15, 2009 11:59 am    Post subject: Re: RecurrencePattern.GetOccurrence() fails on patterns from recurring Tasks [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Recurring tasks don't work the same way as appointments. There is no master
task with a RecurrencePattern that lists all the individual tasks in its
Recurrences and Exceptions collections. Instead, each task created by the
recurrence pattern is an independent item. Therefore, you should be able to
use MAPIFolder.Items.Find to search by the specific date and other
information you know about the task.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Jeff" <budajeff RemoveThis @gmail.com> wrote in message
news:f20f7a93-ef2a-43c7-bf03-9c80a4ed6735@d10g2000yqh.googlegroups.com...
> I'm getting a
>
> "Member not found. (Exception from HRESULT: 0x80020003
> (DISP_E_MEMBERNOTFOUND))"
>
> error when I try to get a particular occurrence of a recurring task.
>
> The MSDN documentation implies that you can get an particular
> occurrence of an appointment or task using the following technique
> (expressed here is pseudocode):
>
> Item recurringItem = NameSpace.GetItemFromId(entryId,storeId);
> RecurrencePattern pattern = recurringItem.GetRecurrencePattern();
> Item occurrence = pattern.GetOccurrence(date);
>
> That approach works correctly w/ recurring appointments,
> however, .GetOccurrence() fails when the item is a task.
>
> I'm sure that there is a recurring task on 'date', b/c I can see the
> task in Outlook. I'm aware of the fact that GetOccurrence() will throw
> an exception if there is no occurrence on that date; that's not the
> issue I'm having.
Back to top
Dmitry Streblechenko
External


Since: Nov 23, 2003
Posts: 1401



PostPosted: Thu Oct 15, 2009 11:59 am    Post subject: Re: RecurrencePattern.GetOccurrence() fails on patterns from recurring Tasks [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Actually on the low level, the recurrence info on tasks is almost exactly
the same as on appointments.
It is just OOM defines the return type of the
RecurrencePattern.GetOccurrence method (that object is shared by both
appointment and taks objects) as Outlook.AppointmentItem, which makes no
sense for tasks.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Sue Mosher [MVP]" <suemvp.DeleteThis@gmail.com> wrote in message
news:%23JO$BCbTKHA.4780@TK2MSFTNGP05.phx.gbl...
> Recurring tasks don't work the same way as appointments. There is no
> master task with a RecurrencePattern that lists all the individual tasks
> in its Recurrences and Exceptions collections. Instead, each task created
> by the recurrence pattern is an independent item. Therefore, you should be
> able to use MAPIFolder.Items.Find to search by the specific date and other
> information you know about the task.
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Jeff" <budajeff.DeleteThis@gmail.com> wrote in message
> news:f20f7a93-ef2a-43c7-bf03-9c80a4ed6735@d10g2000yqh.googlegroups.com...
>> I'm getting a
>>
>> "Member not found. (Exception from HRESULT: 0x80020003
>> (DISP_E_MEMBERNOTFOUND))"
>>
>> error when I try to get a particular occurrence of a recurring task.
>>
>> The MSDN documentation implies that you can get an particular
>> occurrence of an appointment or task using the following technique
>> (expressed here is pseudocode):
>>
>> Item recurringItem = NameSpace.GetItemFromId(entryId,storeId);
>> RecurrencePattern pattern = recurringItem.GetRecurrencePattern();
>> Item occurrence = pattern.GetOccurrence(date);
>>
>> That approach works correctly w/ recurring appointments,
>> however, .GetOccurrence() fails when the item is a task.
>>
>> I'm sure that there is a recurring task on 'date', b/c I can see the
>> task in Outlook. I'm aware of the fact that GetOccurrence() will throw
>> an exception if there is no occurrence on that date; that's not the
>> issue I'm having.
>
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum