In this blog you will see how to get the user’s display name and email address in Outlook Web App.
Please refer my previous articles to create an app for Outlook Web App
Visual Studio 2013: http://www.c-sharpcorner.com/UploadFile/anavijai/office-365-how-to-create-an-app-for-outlook-2013-using-visu/
Napa Tool: http://www.c-sharpcorner.com/UploadFile/anavijai/office-365-how-to-create-an-app-for-outlook-web-app-using-n/
In this blog you will see how to get the user’s display name and email address in Outlook Web App.
AppRead folder: Home.html
- <body>
-
- <div id="content-main">
- <div class="padding">
- <p><strong>Gets the user's display name and email address.</strong></p>
- <table id="details">
- <tr>
- <th>Display Name:</th>
- <td id="displayName"></td>
- </tr>
- <tr>
- <th>Email Address:</th>
- <td id="emailAddress"></td>
- </tr>
- </table>
- </div>
- </div>
- </body>
Home.js
-
-
-
- (function () {
- 'use strict';
-
-
- Office.initialize = function (reason) {
- $(document).ready(function () {
- app.initialize();
-
- displayItemDetails();
- });
- };
-
-
- function displayItemDetails() {
- var userProfile = Office.context.mailbox.userProfile;
- $('#displayName').text(userProfile.displayName);
- $('#emailAddress').text(userProfile.mailAddress);
- }
- })();
Output:
Reference:
https://msdn.microsoft.com/en-us/library/fp161126.aspx