Office 365: How to get the item type 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 item type in Outlook Web App.

AppRead folder: Home.html

  1. <body>  
  2.     <!-- Page content -->  
  3.     <div id="content-main">  
  4.         <div class="padding">  
  5.             <p><strong>Gets the type of item that an instance represents.</strong></p>            
  6.             <table id="details">  
  7.                 <tr>  
  8.                     <th>ItemType:</th>  
  9.                     <td id="itemType"></td>  
  10.                 </tr>               
  11.             </table>  
  12.         </div>  
  13.     </div>      
  14. </body>  

Home.js

  1. /// <reference path="../App.js" />  
  2. /*global app*/  
  3.   
  4. (function () {  
  5.     'use strict';  
  6.   
  7.     // The Office initialize function must be run each time a new page is loaded  
  8.     Office.initialize = function (reason) {  
  9.         $(document).ready(function () {  
  10.             app.initialize();  
  11.   
  12.             displayItemDetails();  
  13.         });  
  14.     };  
  15.   
  16.     // Displays the "Subject" and "From" fields, based on the current mail item  
  17.     function displayItemDetails() {  
  18.         var item = Office.cast.item.toItemRead(Office.context.mailbox.item);  
  19.         $('#itemType').text(item.itemType);       
  20.     }  
  21. })();  

Output:

 

Reference:

https://msdn.microsoft.com/en-us/library/fp161138.aspx

Ebook Download
View all
Learn
View all