We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ExchangeWebServiceClient Listmessages is limited to 1000 messages

Hi there,

When using the code below, List contains 1000 items in a mailbox with 9000+ items.

List = cl.ListMessages(inf.InboxUri, 199999, ExchangeListMessagesOptions.ListRecursive)

Regardless of the second parameter. How can i get the full list of items?


Hi,


Thank you for your inquiry.

Unfortunately, at the moment I don’t have access to a Mailbox having more that 1000 messages to test your requirement. Can you please try the overloaded method of ListMessages that takes the String URI and a Boolean parameter to set the recursive operation.

Below is sample for your reference,
C#

var list = client.ListMessages(client.MailboxInfo.RootUri, true);

When i use that code, i get 1126 items (including calender items). Similar behavior can be observed by using the exchange webservice API provided by microsoft. It loads 1000 items, but you can use paging to get the next 1000 items with a subsequent call to “FindItems” (similar call as listmessages)


Below is the list i get from the MS api when i add a watch in Visual Studio to the list


- list
+ Items Count = 1000 System.Collections.ObjectModel.Collection(Of TItem)
MoreAvailable True Boolean
NextPageOffset 1000 Integer?
TotalCount 9862 Integer
+ Results Expanding will process the collection

Hi,


Thank you for the feedback.

I apologize for your inconvenience. I have logged a ticket (Id: 33115) in our tracking system to get an opinion from the development team on this issue. As soon as I receive any updates, I will provide that for your reference.