Freigeben über


Don't Crawl On Me

[This is now documented here: https://msdn2.microsoft.com/en-us/library/bb905130.aspx

There are a few places in Outlook that need to enumerate the folders in the message stores in a profile. It's usually looking for folders of a certain type. Normally this isn't a problem, but for some message stores this can be a big deal. Consider the Public Folder store. It will typically have thousands of folders, which may be scattered on servers around the world. Crawling through and opening every public folder could be hugely expensive. So most of the logic doing these crawls detects Public Folders and doesn't crawl them.

But what if you've implemented your own message store and would prefer that Outlook not crawl it? This was an issue that came up in a number of bugs, most of which were fixed, but only some were documented. This post gathers them all together and completes the documentation.

Common Information

All of these features will look for a named property exposed on a message store's IMsgStore object. The named properties are integers (PT_LONG) of kind MNID_String in the PSETID_Common namespace. For each named property, if the property is not found or is found but set to 0, then Outlook assumes the store is OK to crawl.

The constants CSM_CLIENT_DO_NOT_CHANGE and ASM_CLIENT_DO_NOT_CHANGE, defined below, are for future reference and are not currently implemented. For now, a store can prevent clients from changing any of these flags by hard coding the values that the store returns for the property.

PSETID_Common has been defined elsewhere, but I repeat it here for completeness:

 const GUID PSETID_Common = {0x00062008, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}};

Common folder crawl

This is the crawl that Outlook performs on boot to ensure it knows about all the Contact, Calendar, Task, etc. folders in the opened stores.

 lpwstrName = L"CrawlSourceSupportMask";
enum 
{
 CSM_DEFAULT              = 0, // Store doesn't care if we crawl or not.
 CSM_DO_NOT_CRAWL         = 1 << 0x0,    // Store doesn't want us to crawl.
 CSM_CLIENT_DO_NOT_CHANGE = 1 << 0xF     // Store won't let the client set the crawl support mask.
};

This property was exposed in hotfixes to both Outlook 2003 (835210) and Outlook 2007 (938893).

Autoarchive

This is the crawl Outlook performs to determine which folders need to be autoarchived. This crawl can be turned off globally, or per store using the named property.

 lpwstrName = L"ArchiveSourceSupportMask";
enum 
{
   ASM_DEFAULT              = 0,        // Allow archiving
   ASM_DO_NOT_ARCHIVE       = 1 << 0x0, // Do not allow archiving
   ASM_CLIENT_DO_NOT_CHANGE = 1 << 0xF  // Do not allow client to set archiving flags
};

This property was exposed in a hotfix to Outlook 2003 (826225). It is present in Outlook 2007 RTM.

Mail Merge Contact Folder Scan

This is the crawl Outlook and Word perform to find contact folders during Mail Merge.

 lpwstrName = L"NoFolderScan";

This property was exposed in a hotfix to Outlook 2003 (842776). It is present in Outlook 2007 RTM.