i created a function which gets all Informations of an appointment item from EWS. I also need the Interval of an RecurrenceItem but it doesnt work. This is what i did:
ExtendedPropertyDefinition PidLidCleanGlobalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, 0x00000023, MapiPropertyType.Binary);
ExtendedPropertyDefinition PidLidDayInterval = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x00000011, MapiPropertyType.Integer);
ExtendedPropertyDefinition PidLidWeekInterval = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x00000012, MapiPropertyType.Integer);
ExtendedPropertyDefinition PidLidMonthInterval = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x00000013, MapiPropertyType.Integer);
ExtendedPropertyDefinition PidLidYearInterval = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x00000014, MapiPropertyType.Integer);
PropertySet propset = new PropertySet(PropertySet.FirstClassProperties);
propset.Add(PidLidCleanGlobalObjectId);
propset.Add(PidLidDayInterval);
propset.Add(PidLidWeekInterval);
propset.Add(PidLidMonthInterval);
propset.Add(PidLidYearInterval);
FindItemsResults < Item > appointments = esb.FindItems(new FolderId(WellKnownFolderName.Calendar, new Mailbox(room)), searchFilter, view);
foreach(Appointment appointment in appointments) {
CalendarObjectClass calobj = new CalendarObjectClass();
appointment.Load(propset);
byte[] value = null;
Int32 interval = 0;
if (appointment.TryGetProperty(PidLidCleanGlobalObjectId, out value)) {
calobj.correlationid = Convert.ToBase64String(value);
}
if (calobj.isrecurring) {
switch (getRecurrenceType(calobj.recurrence)) {
case RecurrenceType.olRecursDaily:
{
if (appointment.TryGetProperty(PidLidDayInterval, out interval)) { // this is the right case but it won't set the instance
calobj.interval = interval;
}
break;
...
}
}
i can't get the interval property. What am i doing wrong? is there another way to solve this problem?
PidLidDayInterval was a WebDAV extension property so it won't work in Exchange 2010 or greater. You should just be able to get the interval from the recurrence pattern eg
((Recurrence.DailyPattern)appointment.Recurrence).Interval)
This would only be available on the Master instance object.
Cheers Glen
User contributions licensed under CC BY-SA 3.0