Gopal Biswas
Gopal Biswas

Reputation: 419

How to ordering emails using EWS managed API in C#

I want to ordering by datetime/sender/subject emails which populated by EWS managed API using C#.I'm populating emails like below-

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
 var itemView = new ItemView(pageSize, offset, OffsetBasePoint.Beginning);
 FindItemsResults<Item> fiitems = null;
 fiitems = service.FindItems(new FolderId(WellKnownFolderName.Inbox, userMailbox), itemView);
 service.LoadPropertiesForItems(fiitems.Items, PropertySet.FirstClassProperties);

Any help will be appreciated.

Upvotes: 2

Views: 664

Answers (1)

Gopal Biswas
Gopal Biswas

Reputation: 419

ItemView view = new ItemView(10, 0, OffsetBasePoint.Beginning);
view.OrderBy.Add(EmailMessageSchema.Subject, SortDirection.Ascending);  

Upvotes: 3

Related Questions