Outlook very slow while looping on CurrentFolder.Items collection

L

lsicard

Hi,

I need to check some headers in a mail collection that can be large
(more than 1000 mails per folder) and it seems that when I cast an
item from the collection outlook needs to retreive all related data
(body, attachments) from the remote server (IMAP) which is causing a
severe delay.
My code :
Outlook.Items items = OutlookApp.ActiveExplorer().CurrentFolder.Items;
foreach (object i in items)
{
Outlook.MailItem item = (Outlook.MailItem)i; //This line is slow
//reading/Writing some headers
}

Is there any way to prevent Outlook from calling the server? I just
need to work on the headers...

Thanks in advance

Louis
 
D

Dominic Shaw

Hi Louis,

Did you ever find a resolution to this? I have almost exactly the same circumstance and I can't seem to find a solution.

What did you do in the end?

Thanks,

Dom
 
D

Dominic Shaw

Hi Louis (& all),

Did you ever find a resolution to this? I have almost exactly the same circumstance and I can't seem to find a solution.

What did you do in the end?

Thanks,

Dom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top