Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximal size of an ItemView in EWS?

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.

like image 302
Luke Avatar asked Oct 10 '12 06:10

Luke


2 Answers

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

like image 154
Jageen Avatar answered Oct 03 '22 14:10

Jageen


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;
            }
        }
like image 45
Raja Shahid Avatar answered Oct 03 '22 12:10

Raja Shahid