EWS:取消重复发生

时间:2013-06-22 13:12:36

标签: .net exchangewebservices ews-managed-api

我正在尝试使用我创建此定期约会的同一帐户取消重复出现。我收到了这个错误:

User must be an organizer for CancelCalendarItem action

当我检查约会的属性时,我发现组织者具有与服务使用的SMTP地址相同的SMTP地址。这个错误没有意义。

我是否需要冒充资源(房间)电子邮件才能取消会议?

我正在尝试取消一系列约会的单次出现。预订代码:

Appointment appointment = new Appointment(service);

            appointment.Subject = Subject;
            appointment.Body = Body;
            appointment.Start = Start;

            foreach (DataRow room in Rooms.Rows)
            {
                appointment.Resources.Add(room["Email"].ToString());
            }
if (Recurring)
            {
                DayOfTheWeek[] days = new DayOfTheWeek[] { (DayOfTheWeek)Start.DayOfWeek };
                appointment.Recurrence = new Recurrence.WeeklyPattern(Start.Date, 1, days);
                appointment.Recurrence.StartDate = Start;
                appointment.Recurrence.NumberOfOccurrences = RecurringOccurances;
            }
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

获得定期约会:

public static DataTable GetRecurringItems(String ID)
        {    
            Appointment recurringMasterItem = Appointment.BindToRecurringMaster(service, new ItemId(ID));
            DataTable RecurringAppoitnments = new DataTable();
            int Occs = recurringMasterItem.Recurrence.NumberOfOccurrences.Value;
            for (int i = 1; i <= Occs; i++)
            {
                Appointment occurrenceOrException2 = Appointment.BindToOccurrence(service, new ItemId(recurringMasterItem.Id.UniqueId), i);
                RecurringAppoitnments.Rows.Add(occurrenceOrException2);

            }

            return RecurringAppoitnments;
        }

//然后我选择了上面的一个重复发生的取消它:

Appointment appointment = Appointment.Bind(service, new ItemId(EWSID));
appointment.CancelMeeting();

当我尝试取消会议时,我得到“用户必须是CancelCalendarItem操作的组织者”,尽管上面使用相同的用户/帐户创建了上述所有操作。

1 个答案:

答案 0 :(得分:0)

尝试模拟用户取消会议。还要确保该ID具有足够的权限来执行此操作。