Outlook 2003 Performance (Items->Add)

M

Michael Tissington

I have an Outlook Journal folders with a lot of items (several thousand).

In my code I do something like MAPIFolder->Items->Add ....

In Outlook 2002 this performs VERY quickly however in Outlook 2003 its takes
almost 30 seconds.

I'm guessing that in Outlook 2003 when I get an items collection it goes
away and creates a view of all the thousands of journal items.

How can I do this differently for better performance.

Thanks!
 
D

Dmitry Streblechenko \(MVP\)

Did you try to cache the Items collection?

Items = MAPIFolder->Items;
Items->Add ....

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

Michael Tissington

Yes as soon as I do

Items = MAPIFolder->Items

The I take a big hit when there are several thousand items in the folder
(this does NOT happen in previous version of Outlook) so I'm wondering if
there is another way of doing the Add.
 
D

Dmitry Streblechenko \(MVP\)

What of you add an item using Extended MAPI (IMAPIFolder::CreateMessage),
then just reopen it in OOM using Namespace.GetItemFromID?

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

Michael Tissington

That may work, but I'll need some flag to let the user close it without
saving it (in other words delete it)
 
Top