whorsfall
asked on
Exchange Folder.FindItems until end of messages.
Hi,
I am using the Microsoft.Exchange.WebServ ices Nuget package the process mail messages.
Here is an extract of my code:
DateTime start_date = new DateTime(2018, 7, 1); //Year, month, day
DateTime end_date = new DateTime(2019, 6, 30);
SearchFilter greaterthanfilter = new SearchFilter.IsGreaterThan OrEqualTo( ItemSchema .DateTimeR eceived, start_date);
SearchFilter lessthanfilter = new SearchFilter.IsLessThanOrE qualTo(Ite mSchema.Da teTimeRece ived, end_date);
SearchFilter filter = new SearchFilter.SearchFilterC ollection( LogicalOpe rator.And, greaterthanfilter, lessthanfilter);
Folder folder = Folder.Bind(_service, WellKnownFolderName.Inbox) ; //Or the folder you want to search in
FindItemsResults<Item> results = folder.FindItems(filter, new ItemView(100));
Now this gets the first group.
How to i next get the next group until it ends.
In other words:
get messages
while (more_messages)
{
get next set of messages
}
Thanks,
Ward.
I am using the Microsoft.Exchange.WebServ
Here is an extract of my code:
DateTime start_date = new DateTime(2018, 7, 1); //Year, month, day
DateTime end_date = new DateTime(2019, 6, 30);
SearchFilter greaterthanfilter = new SearchFilter.IsGreaterThan
SearchFilter lessthanfilter = new SearchFilter.IsLessThanOrE
SearchFilter filter = new SearchFilter.SearchFilterC
Folder folder = Folder.Bind(_service, WellKnownFolderName.Inbox)
FindItemsResults<Item> results = folder.FindItems(filter, new ItemView(100));
Now this gets the first group.
How to i next get the next group until it ends.
In other words:
get messages
while (more_messages)
{
get next set of messages
}
Thanks,
Ward.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.