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 recipients in a read form in Outlook Web App.
AppRead folder: Home.html
- <body>
-
- <div id="content-main">
- <div class="padding">
- <p><strong>Gets the recipients of an email message in a read form.</strong></p>
- <table id="details">
- <tr>
- <th>To Address:</th>
- <td id="toAddress"></td>
- </tr>
- </table>
- </div>
- </div>
- </body>
- Home.js
-
- /// <reference path="../App.js" />
- /*global app*/
-
- (function () {
- 'use strict';
-
- // The Office initialize function must be run each time a new page is loaded
- Office.initialize = function (reason) {
- $(document).ready(function () {
- app.initialize();
-
- displayItemDetails();
- });
- };
-
- // Displays the "Subject" and "From" fields, based on the current mail item
- function displayItemDetails() {
- var item = Office.cast.item.toItemRead(Office.context.mailbox.item);
- // Similaryly to get cc receipients:item.cc and for bcc : item.bcc
- var test=item.to;
- for (var i=0; i<test.length; i++)
- document.getElementById('toAddress').innerHTML += "<b>Display Name:</b> "+ test[i].displayName+ "; <b>Email:</b> "+ test[i].emailAddress+"<br/>";
- }
- })();
-
Output
Reference:
https://msdn.microsoft.com/en-us/library/office/fp142279.aspx