![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
When attempting to change the Categories property of a recurring
appointment, I get this error: Error Number -1179631611: This property cannot be changed for a single instance of a recurring meeting. So how do I change the Categories property of the object that represents the series? In pseudo code, it might look like this: Dim objItems as Object Dim olai As Outlook.AppointmentItem Dim olitms As Outlook.Items Set objItems = olitms.Restrict(strCriteria) For Each olai In objItems If olai.IsRecurring Then 'how to get the series object??? olai.SeriesObject.Categories = strNewCategory '== pseudo code Else olai.Categories = strNewCategory End if Next Thanks in advance. |
Ads |
#2
|
|||
|
|||
![]()
One complication is that I'm trying to do this inside a For Each loop - of
all appointments, including recurrences. I don't know of any way to get the "parent" or "series" AppointmentItem when I've included recurrences in the collection, so I get the whole items collection again (within the outer loop) and this time do not get recurrences. Then I restrict it and loop through the items looking for the EntryID in question. Then I can change the Categories property. Seems like a lot of code... but it works. Dim olai As Outlook.AppointmentItem For Each olai in objItems If Len(olai.Categories) 0 Then 'we want to update the category lngCid = Nz(DLookup("Cat_ID", "tblEntity", _ "Entity_ID = " & olai.BillingInformation)) strCategoryName = Nz(DLookup("CatName", "tblCategory", _ "Cat_ID = " & lngCid)) If olai.IsRecurring Then strEntryID = olai.EntryID Set olRitms = olns.GetDefaultFolder(olFolderCalendar).Items strFilter = "[BillingInformation] = " & QT & olai.BillingInformation & QT Set objRcr = olRitms.Restrict(strFilter) i = 0 Do While i objRcr.Count i = i + 1 If objRcr(i).EntryID = strEntryID Then 'Debug.Print objRcr(i).Subject & ": " & objRcr(i).Categories objRcr(i).Categories = strCategoryName objRcr(i).Save End If Loop Else olai.Categories = strCategoryName End If Next |
#3
|
|||
|
|||
![]()
Use the AppointmentItem.RecurrenceState property to work only with the
master appointments (olApptMaster or olApptNotRecurring) Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "deko" wrote in message ... When attempting to change the Categories property of a recurring appointment, I get this error: Error Number -1179631611: This property cannot be changed for a single instance of a recurring meeting. So how do I change the Categories property of the object that represents the series? In pseudo code, it might look like this: Dim objItems as Object Dim olai As Outlook.AppointmentItem Dim olitms As Outlook.Items Set objItems = olitms.Restrict(strCriteria) For Each olai In objItems If olai.IsRecurring Then 'how to get the series object??? olai.SeriesObject.Categories = strNewCategory '== pseudo code Else olai.Categories = strNewCategory End if Next Thanks in advance. |
#4
|
|||
|
|||
![]()
Use the AppointmentItem.RecurrenceState property to work only with the
master appointments (olApptMaster or olApptNotRecurring) Much better! Thanks for the tip! 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I change the meeting organizer (recurring mtg) in Outlook? | PamImp | Outlook - Calandaring | 0 | March 3rd 06 07:14 PM |
Background Color for Outlook Property Page | paulmcd | Add-ins for Outlook | 2 | February 15th 06 07:38 AM |
How to validate a Custom Property Page | Jack Zhang | Add-ins for Outlook | 1 | February 9th 06 07:22 PM |
"Resize with form" property on custom controls | Vaughan | Outlook - Using Forms | 2 | February 6th 06 08:03 PM |
Can I change Outlook recurring event defaults? | Jobsworth | Outlook - Calandaring | 1 | February 5th 06 02:00 AM |