In the next code i get the messages from the inbox.
Maybe in the future I want to add a filter for example only get the inbox messages from 1-1-2009 until 1-1-2010.
Is this the best way to go to retrieve inbox messages or is there a faster (better performance) way?
Dim ExService As ExchangeService
Dim Vw As New ItemView(50)
Dim Fnd As Boolean = True
While Fnd
Dim InBoxItems As FindItemsResults(Of Item) = ExService.FindItems(WellKnownFolderName.Inbox, Vw)
For Each InboxItm As Item In InBoxItems
InboxItm.Load()
'do something
Next
Vw.Offset = Vw.Offset + 50
Fnd = InBoxItems.MoreAvailable
End While