View Single Post
  #1  
Old January 23rd 06, 05:27 AM posted to microsoft.public.outlook.program_vba
deko
external usenet poster
 
Posts: 15
Default How to find Appointment Item by EntryID?

When looping through a collection of Outlook.Items that includes
recurrences, and a recurring appointment is found, I need to get the
non-recurring appointment in order to change the Categories property.

I want to eliminate the the Do loop below and go directly to the appointment
item in question. I can minimize the iterations of the loop by restricting
the olRitms collection with strFilter, but there must be a way to get the
item by EntryID (?) Any suggestions appreciated...

For Each outlook appointment item including recurrences...

If olai.IsRecurring Then
strEntryID = olai.EntryID
Set olRitms = olns.GetDefaultFolder(olFolderCalendar).Items
Set objRcr = olRitms.Restrict(strFilter)
Do While i objRcr.Count
i = i + 1
If objRcr(i).EntryID = strEntryID Then
objRcr(i).Categories = strCategoryName
objRcr(i).Save
End If
Loop
End If

Next


Ads