【发布时间】:2014-06-13 15:31:14
【问题描述】:
我想以编程方式将事件添加到 SharePoint 2010 中的日历。我获取事件列表并将元素添加到此列表。
SPList list = web.Lists.TryGetList(sCalendarName);
if (list != null)
{
SPListItem item = list.Items.Add();
item["Title"] = "New Event";
item["Description"] = "New Event created using SharePoint Object Model";
item["Location"] = "First Floor";
item["EventDate"] = DateTime.Now;
item["EndDate"] = DateTime.Now.AddDays(2);
item["Category"] = "Business";
item["fAllDayEvent"] = false;
item["Author"] = web.EnsureUser(@"domen\username");
item.Update();
}
但我找不到如何向“参与者”(“与会者”)字段添加值。
如果你看一下 item.Xml,就会看到由 Sharepoint Calendar 界面添加的 ows_ParticipantsPicker 元素,其中包含用户。
如何将参与者(参加者)添加到活动中?
【问题讨论】:
标签: c# sharepoint sharepoint-2010 calendar