You Chose…Wisely

In Outlook 2010, there’s a new feature in the Address Book which I’ll call “Choose automatically”. You’ll find it in the Address Book in Tools/Options under the section “When opening the address book, show this address list first:”. It looks like this:

Address Book Options Showing Choose Automatically Feature

We added this feature to support MultiEx. Before we put the feature in, if you had multiple Exchange mailboxes in the profile, you could only pick one GAL to be your default. If your current mailbox didn’t use that GAL, tough. With “Choose automatically” enabled, Outlook will pick the most appropriate GAL or contact folder for the current mailbox.

I’ll leave the details about which address book gets selected here to someone else. The key issue from a MAPI perspective is that with “Choose automatically” enabled, the Address Book dialog no longer defaults to the container specified by SetDefaultDir. This can result in a poor experience for third party address book providers. Fortunately, you can turn “Choose automatically” off via a setting in the profile.

You’ll find the setting in the IID_CAPONE_PROF profile section. This profile section is widely known on the Internets, but hasn’t been documented before. Here’s the definition:

 // Capone profile section
// {00020D0A-0000-0000-C000-000000000046}

DEFINE_OLEGUID(IID_CAPONE_PROF, 0x00020d0a, 0, 0);

You can open that profile section and toggle the feature on and off by setting the PR_AB_CHOOSE_DIRECTORY_AUTOMATICALLY property:

 #define PR_AB_CHOOSE_DIRECTORY_AUTOMATICALLY PROP_TAG( PT_BOOLEAN, 0x3D1C)

That’s all there is to it. You don’t even have to restart Outlook, though if you have the Address Book open it obviously won’t take effect until you close and reopen it.

Enjoy!