
CDO & Outlook-Out of memory, messages collection
There is a limit of 255 RPC channels per process (each message uses up one).
In .Net you need to trigger the GC every once in a while (100 items?).
An even better solution would *not* to loop through all messages, but to use
Items.Find/FindNext and Items.Restrict.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Quote:
> Hi,
> I have a VB.net Com-Addin project inside Outlook that uses the outlook
> object model
> and CDO 1.21. When looping through a folder that has hundreds or thousands
> of emails, I run into memory problems. After setting the messages
> collection and looping through all the emails, I can not view any of the
> other Outlook folders, like the Inbox.
> The goal is to try and find all the emails from a specific contact, using
> any of the 3 possible contact emails, instead of their name. This would
> include emails that the contact email is found in TO or CC or BCC
> properties.
> Any ideas? Thanks