A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Hot to speed up MailItems access



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 15th 07, 07:47 AM posted to microsoft.public.outlook.program_addins
Ivan
external usenet poster
 
Posts: 39
Default Hot to speed up MailItems access

I get some properties from each MailItem in some folder:

_ItemsPtr spItems = spFolder-Items;
for (int j = 0; j spItems-Count; j++)
{
_MailItemPtr spMailItem = spItems-Item( j+1 );
if ( !spMailItem )
continue;

// SenderEmailAddress, SenderName, SentOn, Subject and Recipients
properties reading here
}

But this code is very slow. Only 130 messages per second even without
reading any properties.

How can I speed up mail items processing greatly? I need to process
thousands of emails...

Thanks.
  #2  
Old June 15th 07, 12:50 PM posted to microsoft.public.outlook.program_addins
Ivan
external usenet poster
 
Posts: 39
Default How to speed up MailItems access

I've tried out this using ExMAPI - speed was increased greatly.
  #3  
Old June 15th 07, 07:28 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to speed up MailItems access

Have a look at the Items.SetColumns methods.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ivan" wrote in message
...
I've tried out this using ExMAPI - speed was increased greatly.



  #4  
Old June 26th 07, 06:04 AM posted to microsoft.public.outlook.program_addins
Ivan
external usenet poster
 
Posts: 39
Default How to speed up MailItems access

Thanks, Dmitry!
When I tried to use this method in OOM it always returns null. I don't know
why.
Using MAPI, IMAPITable.SetColumns works fine.

  #5  
Old June 26th 07, 06:02 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to speed up MailItems access

I am not sure what you mean - SetColumns in OOM does not return anything; it
simply tells Outlook which properties you are planning to access later from
the Items collection so that Outlook can make sure these properties get
cached from the underlying MAPI table.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ivan" wrote in message
...
Thanks, Dmitry!
When I tried to use this method in OOM it always returns null. I don't
know
why.
Using MAPI, IMAPITable.SetColumns works fine.



  #6  
Old June 27th 07, 04:38 AM posted to microsoft.public.outlook.program_addins
Ivan
external usenet poster
 
Posts: 39
Default How to speed up MailItems access

Sorry for the confusion. I mean that after calling SetColumns in OOM every
returned item from Items collection is null.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Duplicate Mailitems Geoff Outlook and VBA 7 October 19th 06 04:21 PM
Sending MailItems from Outbox part 2 Tom at GSD Add-ins for Outlook 6 September 14th 06 06:42 PM
Sending MailItems from Outbox withour dropping emails Tom at GSD Add-ins for Outlook 0 September 12th 06 07:01 PM
How To: select mailitems from my inbox? NFR Outlook - Using Forms 1 May 16th 06 03:41 PM
How to work with MailItems after pressing Send-Button Darius Add-ins for Outlook 5 January 20th 06 03:27 PM


All times are GMT +1. The time now is 08:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.