Api 在Exchange 2010中加载所有约会属性,包括扩展属性
我试图列出与给定日历约会相关的所有属性,但我不知道是否有方法不单独加载每个属性。根据我在网上看到的一些代码,我知道我可以做如下事情:Api 在Exchange 2010中加载所有约会属性,包括扩展属性,api,calendar,exchangewebservices,exchange-server-2010,Api,Calendar,Exchangewebservices,Exchange Server 2010,我试图列出与给定日历约会相关的所有属性,但我不知道是否有方法不单独加载每个属性。根据我在网上看到的一些代码,我知道我可以做如下事情: /// <summary> /// List all the properties of an appointment /// </summary> public void listProps() { Folder myCalendar = Folder.Bind(service, W
/// <summary>
/// List all the properties of an appointment
/// </summary>
public void listProps()
{
Folder myCalendar = Folder.Bind(service, WellKnownFolderName.Calendar);
ItemView view = new ItemView(10);
FindItemsResults<Item> findResults;
do
{
findResults = myCalendar.FindItems(new SearchFilter.IsEqualTo(ItemSchema.ExtendedProperties, MyPropertySetId), view);
service.LoadPropertiesForItems(findResults, new PropertySet(ItemSchema.Subject, ItemSchema.Body));
foreach (Item item in findResults)
{
Console.WriteLine(item.Subject);
Console.WriteLine(item.Body);
}
if (findResults.NextPageOffset.HasValue)
{
view.Offset = findResults.NextPageOffset.Value;
}
} while (findResults.MoreAvailable);
}
这可能吗
谢谢 不,这是不可能的 您可以使用预定义的属性集,如:
PropertySet.FirstClassProperties
来获取已知的属性集
根本不支持以这种方式获取扩展属性。必须明确指定要访问的扩展属性。例如:
ItemView view = new ItemView(10);
ExtendedPropertyDefinition extendedPropertyDefinition =
new ExtendedPropertyDefinition("Expiration Date", MapiPropertyType.String);
view.PropertySet =
new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Subject,extendedPropertyDefinition);
ItemView view = new ItemView(10);
ExtendedPropertyDefinition extendedPropertyDefinition =
new ExtendedPropertyDefinition("Expiration Date", MapiPropertyType.String);
view.PropertySet =
new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Subject,extendedPropertyDefinition);