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;
}
}
The default policy in Exchange limits the page size to 1000 items. Setting the page size to a value that is greater than this number has no practical effect. Applications should also account for the fact that the EWSFindCountLimit throttling parameter value may result in a partial result set being returned for applications that make concurrent requests.
http://msdn.microsoft.com/en-us/library/office/jj945066(v=exchg.150).aspx
© 2022 - 2024 — McMap. All rights reserved.
var privateContacts = service.FindItems(WellKnownFolderName.Contacts, new ItemView(9999));
it always gets me to a limit of 1000... – Sami