2
votes

I have managed to return all the profiles using this registry path:- HKEY_CURRENT_USER\Software\Microsoft\Office\xx.0\Outlook\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000002

However I am now wondering how to determine the default profile. In other words is there a reg key that identifies the default profile from the rest of the profiles.

Thank you in advance.

2
How do you define "default" profile? There is no "default" profile. Sometimes when you don't give it a name, Outlook will just name it "Default", but that's really about it. It doesn't have any magical properties.rory.ap
@roryap in Outlook you can define a default profile - which gets focused first in your profilelist at startupCadburry
@roryap - Control Panel | Mail | Show Profiles | Always use this profile.Dmitry Streblechenko

2 Answers

5
votes

Outlook 97-2010 The REG_SZ DefaultProfile under HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles contains the value (subkeyname) of the default profile.

Since Outlook 2013 (v15) The same structure exists for newer versions in HKEY_CURRENT_USER\Software\Microsoft\Office\%version%\Outlook\Profiles

enter image description here

1
votes

The officially supported way (Extended MAPI in C++ or Delphi, works in all versions of Outlook) is to use the IMAPITable object returned from IProfAdmin::GetProfileTable and look for a row with the PR_DEFAULT_PROFILE property == true. You can see it in OutlookSpy (click IProfAdmin button).

If using Redemption (any language) is an option, you can do the following:

Set rSession = CreateObject("Redemption.RDOSession")
MsgBox rSession.Profiles.DefaultProfileName