View Single Post
  #2  
Old September 25th 07, 03:16 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Optimize iteration through mailitems

According to the Object Browser Help on SetColumns using EntryID will cause
an error.

If your user properties have been added to the folder and not just the items
you can use a filter or restriction if you're looking for specific values in
the user properties (for example a user property that has the value True).

Are you just using the Outlook object model or are you also using an
alternate API such as Redemption? If you're using Redemption or Outlook 2007
you could set up a request for a MAPITable object that just returns the
columns represented by your user properties plus anything else you might
need such as EntryID, that would be extremely fast, probably about an order
of magnitude faster than any method using the Outlook object model. You
could also filter or restrict that returned table object for even faster
performance.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


wrote in message
ups.com...
I'm currently experiencing very bad performance while iterating
through the mailitems in a folder. I have to do this to check some
values in a couple of my custom properties every time a user is
switching folders.
I have read a lot about the Items.SetColumns() method, but can't seem
to get it to work with my custom properties.
This method is supposed to cache the properties you want to use, so
Outlook doesn't need to open every property of every mailitem you
visit.

Examples of what I have tried:
items.SetColumns("Storage"); // where Storage is my custom property
items.SetColumns("http://schemas.microsoft/mapi/string/
{00020329-0000-0000-C000-000000000046}/Storage");
items.SetColumns("http://schemas.microsoft/mapi/id/{00020329-0000-0000-
C000-000000000046}/0x8020001E"); // 8020 is according to outlook spy
the tag for this property and 001E is the tag for STRING8
items.SetColumns("http://schemas.microsoft/mapi/proptag/0x8020001E");

In addition, I have tried every possible combination of the above,
with no luck...

Any suggestions!??

The method does work with EntryID, Subject and fields like that, but
not with my custom ones..

Any help would be appreciated


Ads