Office.UserProfile interface

Information about the user associated with the mailbox. This includes their account type, display name, email address, and time zone.

Remarks

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

Properties

accountType

Gets the account type of the user associated with the mailbox.

Note: This member is currently only supported in Outlook 2016 or later on Mac, build 16.9.1212 and greater.

displayName

Gets the user's display name.

emailAddress

Gets the user's SMTP email address.

timeZone

Gets the user's time zone in Windows format.

The system time zone is usually returned. However, in Outlook on the web, the default time zone in the calendar preferences is returned instead.

Property Details

accountType

Gets the account type of the user associated with the mailbox.

Note: This member is currently only supported in Outlook 2016 or later on Mac, build 16.9.1212 and greater.

accountType: string;

Property Value

string

Remarks

[ API set: Mailbox 1.6 ]

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

The possible account types are listed in the following table.

Value Description
enterprise The mailbox is on an on-premises Exchange server.
gmail The mailbox is associated with a Gmail account.
office365 The mailbox is associated with a Microsoft 365 work or school account.
outlookCom The mailbox is associated with a personal Outlook.com account.

Note: For hybrid Exchange environments, the returned account type value depends on where the mailbox is hosted. If the mailbox is on an on-premises server, the account type value is enterprise. However, if it's hosted on Exchange Online, the account type value is office365.

Examples

console.log(Office.context.mailbox.userProfile.accountType);

displayName

Gets the user's display name.

displayName: string;

Property Value

string

Remarks

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

Examples

// Example: Allie Bellew
console.log(Office.context.mailbox.userProfile.displayName);

emailAddress

Gets the user's SMTP email address.

emailAddress: string;

Property Value

string

Remarks

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

Examples

// Example: allieb@contoso.com
console.log(Office.context.mailbox.userProfile.emailAddress);

timeZone

Gets the user's time zone in Windows format.

The system time zone is usually returned. However, in Outlook on the web, the default time zone in the calendar preferences is returned instead.

timeZone: string;

Property Value

string

Remarks

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

Examples

// Example: Pacific Standard Time
console.log(Office.context.mailbox.userProfile.timeZone);