'Identifying default outlook profile
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.
Solution 1:[1]
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
Solution 2:[2]
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 (I am its author - click IProfAdmin button).
If using Redemption (any language, I am also its author) is an option, you can do the following:
Set rSession = CreateObject("Redemption.RDOSession")
MsgBox rSession.Profiles.DefaultProfileName
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 |