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

It sounds like you want to change the Categories value for all the
occurrences in a series - is that right? In that case you need to make the
change to the recurrence master. I assume from your description that
"olai" is obtained by iterating through an Items collection where
IncludeRecurrences = True.


Yes - my code is automation from Access. I get a collection of
Outlook.Items and loop through it to update each appointment's Categories
property. What I was missing was an understanding of the RecurrenceState
method. Now my code looks like this:

Dim olai as Outlook.AppointmentItem

For each olai in olItems

If olai.Categories strNewCategoryName Then
If olai.IsRecurring Then
If olai.RecurrenceState = olApptMaster Then
olai.Categories = strNewCategoryName
End If
Else
olai.Categories = strNewCategoryName
End If
End If

Next

The GetItemFromID method was what I was looking for in my original post, but
thanks to Dmitry Streblechenko's reply to a different post, I'm not sure I
need it for this procedure.

Thanks for the tip nonetheless.


Ads