Last modified: July 23, 2011

Applies to: Outlook

Assigns a new name to a profile.

HRESULT RenameProfile(
  LPSTR lpszOldProfileName,
  LPSTR lpszOldPassword,
  LPSTR lpszNewProfileName,
  ULONG_PTR ulUIParam,
  ULONG ulFlags


[in] A pointer to the current name of the profile to rename.


[in] Always NULL.


[in] A pointer to the new name of the profile to rename.


[in] A handle to the parent window of any dialog boxes or windows that this method displays.


[in] Always NULL.


The profile was successfully renamed.


The profile password is incorrect.


The user canceled the operation, typically by clicking the Cancel button in a dialog box.

The IProfAdmin::RenameProfile method assigns a new name to a profile, if it has one. If the profile to rename is in use by a client when RenameProfile is called, RenameProfile marks the profile and returns S_OK instead of attempting the rename operation while the profile is in use. When the profile is no longer being used, RenameProfile assigns it the new name.

The old and new names of the profile can be up to 64 characters in length and can include the following characters:

  • All alphanumeric characters, including accent characters and the underscore character.

  • Embedded spaces, but not leading or trailing spaces.

The lpszPassword should always be NULL or a pointer to a zero-length string.