Export (0) Print
Expand All

UserProfile object (JavaScript API for Office)

apps for Office

Represents the host application's user profile information.

Last modified: March 04, 2015

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office".

Hosts:Outlook

App type: Mail

Available in requirement sets

Mailbox

Last changed in Mailbox

1.0

Applicable Outlook modes

Compose or read

See all support details

Office.context.mailbox.userProfile

Properties

Property name

Outlook mode

Description

Introduced in

displayName

Compose or read

The user name to use for display.

Version 1.0

emailAddress

Compose or read

The user's SMTP email address.

Version 1.0

timeZone

Compose or read

The user's local time zone.

Version 1.0

The UserProfile object is returned as the userProfile property of the Mailbox object.

The following JavaScript code sample shows how to access the displayName property of the UserProfile object which represents the current user in Microsoft Outlook.

Office.initialize = function () {
    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    var userProfile = Office.context.mailbox.userProfile;
    var name = userProfile.displayName;
    // Continue with processing the user's display name.   
    });
}

A checkmark (√) in the following table indicates that this property is supported in the corresponding Outlook host application. An empty cell indicates that the Outlook host application doesn't support this property.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

Supported hosts, by platform

Office for Windows desktop

Office for Windows RT

Office Online
(in browser)

OWA for Devices

Office for Mac

Outlook

√ (Read mode only)

Available in requirement sets

Mailbox

Minimum permission level

ReadItem

App types

Mail

Library

Office.js

Namespace

Office

Version

Changes

1.0

Introduced

Show:
© 2015 Microsoft