12,162
社区成员
发帖
与我相关
我的任务
分享
Microsoft.Exchange.WebServices.Data.ServiceObjectPropertyException: You must load or assign this property before you can read its value.
在 Microsoft.Exchange.WebServices.Data.PropertyBag.get_Item(PropertyDefinition propertyDefinition)
在 Microsoft.Exchange.WebServices.Data.Item.get_Body()
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
foreach (Item item in findResults.Items)
{
list.Add(item.Subject.ToString());
list.Add(item.DateTimeSent.ToShortDateString());
list.Add(item.Id.ToString());
//HTML如果不为空
if (item.Body != null)
{
//html格式的内容
MessageBody body = item.Body;
//读取文本
list.Add(body.Text.ToString());
}
}
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox,SetFilter(), view);
PropertySet detailedPropertySet = new PropertySet(BasePropertySet.FirstClassProperties, AppointmentSchema.Recurrence);
service.LoadPropertiesForItems(from Item item in findResults select item, detailedPropertySet);