Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Sets or clears a client's default profile.

HRESULT SetDefaultProfile(
  LPTSTR lpszProfileName,
  ULONG ulFlags


[in] A pointer to the name of the profile that will become the default, or NULL. Setting lpszProfileName to NULL indicates that SetDefaultProfile should remove the existing default profile, leaving the client without a default.


[in] A bitmask of flags that controls the type of the string pointed to by lpszProfileName. The following flag can be set:


The profile name is in Unicode format. If the MAPI_UNICODE flag is not set, the profile name is in ANSI format.


A default profile was successfully established or removed.


The specified profile does not exist.

The IProfAdmin::SetDefaultProfile method either establishes a particular profile as the client's default profile or clears the current default profile. The default profile is the profile that is automatically used whenever the client begins a MAPI session. SetDefaultProfile also sets the new default profile's PR_DEFAULT_PROFILE (PidTagDefaultProfile) property to TRUE.

To start a session with the default profile, pass the MAPI_USE_DEFAULT flag to the MAPILogonEx function.

© 2015 Microsoft