The ViewSize
is specified at constructor level. I found the documentation for the constructor, but it doesn't say how big the maximal size is.
There is limit of 2,147,483,647 as it's data type is Int32, I used it and also tested it not return any error if we pass ItemView(2147483647);
It's just define page size of search item,if there are more search item results than the view page size,subsequent calls that use ItemView offsets must be performed to return the rest of the results.
ref - http://msdn.microsoft.com/en-us/library/exchange/dd633693%28v=exchg.80%29.aspx http://msdn.microsoft.com/en-us/library/system.int32.maxvalue.aspx
You can specify Int32 value in ItemView constructor but only thousand items will be returnd. You have to specify a loop to get the remaining items.
bool more = true;
ItemView view = new ItemView(int.MaxValue, 0, OffsetBasePoint.Beginning);
view.PropertySet = PropertySet.IdOnly;
FindItemsResults<Item> findResults;
List<EmailMessage> emails = new List<EmailMessage>();
while (more)
{
findResults = service.FindItems(WellKnownFolderName.Inbox, view);
foreach (var item in findResults.Items)
{
emails.Add((EmailMessage)item);
}
more = findResults.MoreAvailable;
if (more)
{
view.Offset += 1000;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With