简体   繁体   中英

Reading all data in custom Task.itemClass on Exchange server using EWS

I am developing C# .NET Framework 4.5.2 application using EWS Managed API 2.1 with Exchange Server 2007

I am trying to read Task data from PublicFolders and save the contents elsewhere. So far I have been successful to read the body of the Task, but I m still missing some. These Tasks are using custom templates build in Outlook designer mode and they are adding some fields in the header of the task.

With Task.ItemClass I'm able to get the name of that template, but I didnt figure out how to load those fields (and their values) with the task.

Task tsk = Task.Bind(service, idHP);
tsk.Load();
string tClass = tsk.ItemClass;   //Gets the custom class name
MessageBody tskBody = tsk.Body;  //Loads properly content, but without headers defined 
                                 //in custom class name

Is there a way how to load all of the data according to selected ItemClass? Do I have to change something in the Outlook/Exchnage server settings? I'd be glad for any help.

You need to define the Extended properties that have been used (see https://msdn.microsoft.com/en-us/library/office/dn467898(v=exchg.150).aspx for a description of what Extended properties are in Exchange I would also suggest you use a Mapi editor to look at some of the Items). Then use a propertyset to tell Exchange to return those properties to you in the Bind line of your code eg https://msdn.microsoft.com/en-us/library/office/dd633697(v=exchg.80).aspx

cheers Glen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM