Find and restrict search doesn't collect all items

X

xupixaxi

Hi, I am doing a normal search (find and restrict) through items in my
calendar (a year span),
including recurrences, sorting, etc.The search works fine except that if one
of the recurrent items has been moved to some other date, it is not collected
between the found items.
In example, I have a set of meeings that happen every 4th thursday of the
month. July meeting was changed to the third thirsday, so I just moved with
the mouse the appointment in my calendar. If I try to open july appt, It
displays the msgbox asking you if you want to open all recurrent items or
just this one, so I asume it is still between the recurrence. But if i search
through VBA, doesn't appear in the items selected.
The search is done by categories and all items on the recurrent patern have
the same category. So does the moved one, or at least, that what it says at
the bottom of the form, shaded in gray.
If you just delete the item and add a new one, equal to as the recurrent
ones, but out of the recurrence, like if it had nothing to do with them, it
appears between the found items without problems.
Weird behaviour...I don't now if it is an outlook bug or what is it, and I
have searched the forums for info on this and found nothing, any help? Can
anyone replicate this behaviour?
By the way, the search filter is correct and the sort by start and include
recurrences too.
 
K

Ken Slovak

Items like that are kept in an Exceptions collection. You have to traverse
that if you want to get at items you've changed.
 
X

xupixaxi

how is that done? How do I include the exceptions collections? Is there a
property or method to do so, like colAppt.includeExceptions?
 
K

Ken Slovak

You get the master appointment of the recurring series and that has an
Exceptions collection.

Dim oRecur As Outlook.RecurrencePattern
Dim colExceptions As Outlook.Exceptions
Dim oApptException As Outlook.AppointmentItem

Set oRecur = oAppt.GetRecurrencePattern
Set colExceptions = oRecur.Exceptions

If colExceptions.Count > 0 Then
For i = 1 to colExceptions.Count
Set oApptException = colExceptions.Item.AppointmentItem
'whatever
Next
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top