Extrair cadeias de caracteres de entidade de um item do Outlook

Este artigo descreve como criar um suplemento do Outlook de entidades de exibição que extrai instâncias de cadeia de caracteres de entidades bem conhecidas com suporte no assunto e no corpo do item selecionado do Outlook. Esse item pode ser um compromisso, uma mensagem de email ou solicitação, resposta ou cancelamento de reunião.

Importante

Os suplementos contextuais do Outlook baseados em entidade serão desativados no segundo trimestre de 2024. O trabalho para aposentar esse recurso começará em maio e continuará até o final de junho. Após junho, os suplementos contextuais não poderão mais detectar entidades em itens de email para executar tarefas neles. As APIs a seguir também serão retiradas.

Para ajudar a minimizar possíveis interrupções, o seguinte ainda será suportado depois que os suplementos contextuais baseados em entidade forem retirados.

  • Uma implementação alternativa do botão Ingressar Reunião , que é ativado por suplementos de reunião online, está sendo desenvolvida. Depois que o suporte para suplementos contextuais baseados em entidade terminar, os suplementos de reunião online farão a transição automática para a implementação alternativa para ativar o botão Ingressar Reunião .
  • As regras de expressão regular continuarão a ser suportadas depois que os suplementos contextuais baseados em entidade forem retirados. Recomendamos atualizar seu suplemento contextual para usar regras de expressão regulares como uma solução alternativa. Para obter diretrizes sobre como implementar essas regras, consulte Usar regras regulares de ativação de expressão para mostrar um suplemento do Outlook.

Para obter mais informações, consulte Aposentadoria de suplementos contextuais do Outlook baseados em entidade.

As entidades compatíveis incluem:

  • Endereço: um endereço postal brasileiro, com pelo menos um subconjunto dos elementos de um número de rua, nome de rua, cidade, estado e CEP.

  • Contato: informações de contato de uma pessoa, no contexto das outras entidades, como endereço ou nome comercial.

  • Endereço de email: um endereço de email SMTP.

  • Sugestão de reunião: uma sugestão de reunião, como uma referência a um evento. Observe que somente as mensagens, e não compromissos, dão suporte à extração de sugestões de reunião.

  • Número do telefone: um número de telefone brasileiro.

  • Sugestão de tarefa: uma sugestão de tarefa, normalmente expressa em uma frase acionável.

  • URL

A maioria dessas entidades depende de reconhecimento de linguagem natural, que é baseado no aprendizado da máquina de grandes quantidades de dados. Esse reconhecimento não é determinístico e às vezes depende do contexto do item do Outlook.

O Outlook ativa o suplemento de entidades sempre que o usuário seleciona um compromisso, uma mensagem de email ou uma solicitação, resposta ou cancelamento de reunião para visualização. Durante a inicialização, o suplemento de entidades de exemplo lê todas as instâncias das entidades compatíveis do item atual.

O suplemento fornece botões para o usuário escolher um tipo de entidade. Quando o usuário seleciona uma entidade, o suplemento exibe instâncias da entidade selecionada no painel do suplemento. As seções a seguir listam o manifesto XML e arquivos HTML e JavaScript do suplemento de entidades, e realçam o código que dá suporte à extração de entidade respectiva.

Manifesto XML

Observação

O recurso de suplemento do Outlook descrito neste artigo usa regras de ativação, que não têm suporte em suplementos que usam o manifesto unificado para o Microsoft 365.

O suplemento de entidade tem duas regras de ativação unidas por um operador lógico OU.

<!-- Activate the add-in if the current item in Outlook is an email or appointment item. -->
<Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message"/>
    <Rule xsi:type="ItemIs" ItemType="Appointment"/>
</Rule>

Essas regras especificam que o Outlook deve ativar esse suplemento quando o item selecionado no momento no Painel de Leitura ou no inspetor de leitura é um compromisso ou uma mensagem (incluindo mensagem de email ou solicitação, resposta ou cancelamento de reunião).

A seguir temos o manifesto do suplemento das entidades. Ele usa a versão 1.1 do esquema de manifestos de suplementos do Office.

<?xml version="1.0" encoding="utf-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" 
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" 
xsi:type="MailApp">
  <Id>6880A140-1C4F-11E1-BDDB-0800200C9A68</Id>
  <Version>1.0</Version>
  <ProviderName>Microsoft</ProviderName>
  <DefaultLocale>EN-US</DefaultLocale>
  <DisplayName DefaultValue="Display entities"/>
  <Description DefaultValue=
     "Display known entities on the selected item."/>
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="Mailbox" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <!-- Change the following line to specify the web -->
        <!-- server where the HTML file is hosted. -->
        <SourceLocation DefaultValue=
          "http://webserver/default_entities/default_entities.html"/>
        <RequestedHeight>350</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadItem</Permissions>
  <!-- Activate the add-in if the current item in Outlook is -->
  <!-- an email or appointment item. -->
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message"/>
    <Rule xsi:type="ItemIs" ItemType="Appointment"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
</OfficeApp>

Implementação HTML

O arquivo HTML do suplemento de entidades especifica botões para o usuário selecionar cada tipo de entidade e outro botão para limpar instâncias exibidas de uma entidade. Ele inclui um arquivo JavaScript, default_entities.js, que é descrito na próxima seção em Implementação de JavaScript. O arquivo JavaScript inclui os manipuladores de evento para cada um dos botões.

Observe que todos os suplementos do Outlook devem incluir o office.js. O arquivo HTML a seguir inclui a versão 1.1 do office.js na CDN (rede de entrega de conteúdo).

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" >
    <title>standard_item_properties</title>
    <link rel="stylesheet" type="text/css" media="all" href="default_entities.css" />
    <script type="text/javascript" src="MicrosoftAjax.js"></script>
    <!-- Use the CDN reference to Office.js. -->
    <script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script>
    <script type="text/javascript"  src="default_entities.js"></script>
</head>

<body>
    <div id="container">
        <div id="button">
        <input type="button" value="clear" 
            onclick="myClearEntitiesBox();">
        <input type="button" value="Get Addresses" 
            onclick="myGetAddresses();">
        <input type="button" value="Get Contact Information" 
            onclick="myGetContacts();">
        <input type="button" value="Get Email Addresses" 
            onclick="myGetEmailAddresses();">
        <input type="button" value="Get Meeting Suggestions" 
            onclick="myGetMeetingSuggestions();">
        <input type="button" value="Get Phone Numbers" 
            onclick="myGetPhoneNumbers();">
        <input type="button" value="Get Task Suggestions" 
            onclick="myGetTaskSuggestions();">
        <input type="button" value="Get URLs" 
            onclick="myGetUrls();">
        </div>
        <div id="entities_box"></div>
    </div>
</body>
</html>

Folha de estilos

O suplemento de entidades usa um arquivo CSS opcional, default_entities.css, para especificar o layout da saída. A seguir temos uma listagem do arquivo CSS.

{
    color: #FFFFFF;
    margin: 0px;
    padding: 0px;
    font-family: Arial, Sans-serif;
}
html 
{
    scrollbar-base-color: #FFFFFF;
    scrollbar-arrow-color: #ABABAB; 
    scrollbar-lightshadow-color: #ABABAB; 
    scrollbar-highlight-color: #ABABAB; 
    scrollbar-darkshadow-color: #FFFFFF; 
    scrollbar-track-color: #FFFFFF;
}
body
{
    background: #4E9258;
}
input
{
    color: #000000;
    padding: 5px;
}
span
{
    color: #FFFF00;
}
div#container
{
    height: 100%;
    padding: 2px;
    overflow: auto;
}
div#container td
{
    border-bottom: 1px solid #CCCCCC;
}
td.property-name
{
    padding: 0px 5px 0px 0px;
    border-right: 1px solid #CCCCCC;
}
div#meeting_suggestions
{
    border-top: 1px solid #CCCCCC;
}

Implementação de JavaScript

As seções restantes descrevem como essa amostra (arquivo default_entities.js) extrai entidades conhecidas do assunto e do corpo da mensagem ou do compromisso que o usuário está exibindo.

Extrair entidades na inicialização

Após o evento Office.initialize, o suplemento de entidades chama o método getEntities do item atual. O getEntities método retorna à variável _MyEntities global uma matriz de instâncias de entidades com suporte. A seguir apresentamos o código JavaScript relacionado.

// Global variables
let _Item;
let _MyEntities;

// The initialize function is required for all add-ins.
Office.initialize = function () {
    const _mailbox = Office.context.mailbox;
    // Obtains the current item.
    _Item = _mailbox.item;
    // Reads all instances of supported entities from the subject 
    // and body of the current item.
    _MyEntities = _Item.getEntities();
    
    // Checks for the DOM to load using the jQuery ready method.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    });
}

Extrair endereços

Quando o usuário clica no botão Obter Endereços, o manipulador de eventos myGetAddresses obtém uma matriz dos endereços da propriedade addresses do objeto _MyEntities, caso algum endereço seja extraído. Cada endereço extraído é armazenado como uma cadeia de caracteres da matriz. myGetAddresses forma uma cadeia de caracteres HTML local em htmlText para exibir a lista de endereços extraídos. A seguir, apresentamos o código JavaScript relacionado.

// Gets instances of the Address entity on the item.
function myGetAddresses()
{
    let htmlText = "";

    // Gets an array of postal addresses. Each address is a string.
    const addressesArray = _MyEntities.addresses;
    for (let i = 0; i < addressesArray.length; i++)
    {
        htmlText += "Address : <span>" + addressesArray[i] + "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair informações de contato

Quando o usuário clica no botão Obter Informações de Contato , o myGetContacts manipulador de eventos obtém uma matriz de contatos junto com suas informações da propriedade contatos do _MyEntities objeto, se algum tiver sido extraído. Cada contato extraído é armazenado como o objeto Contact na matriz. myGetContacts obtém mais dados sobre cada contato. Observe que o contexto determina se o Outlook pode extrair um contato de um item , uma assinatura no final de uma mensagem de email ou pelo menos algumas das informações a seguir teriam que existir nas proximidades do contato.

  • A cadeia de caracteres que representa o nome do contato da propriedade Contact.personName.

  • A cadeia de caracteres que representa o nome comercial associado ao contato na propriedade Contact.businessName.

  • A matriz de números de telefone associada ao contato na propriedade Contact.phoneNumbers. Cada número de telefone é representado por um objeto PhoneNumber.

  • Para cada membro PhoneNumber na matriz de números de telefone, a cadeia de caracteres que representa o número de telefone da propriedade PhoneNumber.phoneString.

  • A matriz de URLs associada ao contato na propriedade Contact.urls. Cada URL é representada como uma cadeia de caracteres em um membro da matriz.

  • A matriz de endereços de email associada ao contato na propriedade Contact.emailAddresses. Cada endereço de email é representado como uma cadeia de caracteres em um membro da matriz.

  • A matriz de endereços postais associada ao contato na propriedade Contact.addresses. Cada endereço postal é representado como uma cadeia de caracteres em um membro da matriz.

myGetContacts forma uma cadeia de caracteres HTML local em htmlText para exibir os dados de cada contato. A seguir apresentamos o código JavaScript relacionado.

// Gets instances of the Contact entity on the item.
function myGetContacts()
{
    let htmlText = "";

    // Gets an array of contacts and their information.
    const contactsArray = _MyEntities.contacts;
    for (let i = 0; i < contactsArray.length; i++)
    {
        // Gets the name of the person. The name is a string.
        htmlText += "Name : <span>" + contactsArray[i].personName +
            "</span><br/>";

        // Gets the company name associated with the contact.
        htmlText += "Business : <span>" + 
        contactsArray[i].businessName + "</span><br/>";

        // Gets an array of phone numbers associated with the 
        // contact. Each phone number is represented by a 
        // PhoneNumber object.
        let phoneNumbersArray = contactsArray[i].phoneNumbers;
        for (let j = 0; j < phoneNumbersArray.length; j++)
        {
            htmlText += "PhoneString : <span>" + 
                phoneNumbersArray[j].phoneString + "</span><br/>";
            htmlText += "OriginalPhoneString : <span>" + 
                phoneNumbersArray[j].originalPhoneString +
                "</span><br/>";
        }

        // Gets the URLs associated with the contact.
        let urlsArray = contactsArray[i].urls;
        for (let j = 0; j < urlsArray.length; j++)
        {
            htmlText += "Url : <span>" + urlsArray[j] + 
                "</span><br/>";
        }

        // Gets the email addresses of the contact.
        let emailAddressesArray = contactsArray[i].emailAddresses;
        for (let j = 0; j < emailAddressesArray.length; j++)
        {
           htmlText += "E-mail Address : <span>" + 
               emailAddressesArray[j] + "</span><br/>";
        }

        // Gets postal addresses of the contact.
        let addressesArray = contactsArray[i].addresses;
        for (let j = 0; j < addressesArray.length; j++)
        {
          htmlText += "Address : <span>" + addressesArray[j] + 
              "</span><br/>";
        }

        htmlText += "<hr/>";
        }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair endereços de email

Quando o usuário clica no botão Obter endereços Email, o myGetEmailAddresses manipulador de eventos obtém uma matriz de endereços de email SMTP da propriedade emailAddresses do _MyEntities objeto, se algum tiver sido extraído. Cada endereço de email extraído é armazenado como uma cadeia de caracteres na matriz. myGetEmailAddresses forma uma cadeia de caracteres HTML local em htmlText para exibir a lista de endereços de email extraídos. A seguir apresentamos o código JavaScript relacionado.

// Gets instances of the EmailAddress entity on the item.
function myGetEmailAddresses() {
    let htmlText = "";

    // Gets an array of email addresses. Each email address is a 
    // string.
    const emailAddressesArray = _MyEntities.emailAddresses;
    for (let i = 0; i < emailAddressesArray.length; i++) {
        htmlText += "E-mail Address : <span>" + emailAddressesArray[i] + "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair sugestões de reunião

Quando o usuário clica no botão Obter Sugestões de Reunião, o manipulador de eventos myGetMeetingSuggestions obtém uma matriz de sugestões de reunião da propriedade meetingSuggestions do objeto _MyEntities, caso algum seja extraído.

Observação

Somente mensagens, mas não compromissos, dão suporte ao MeetingSuggestion tipo de entidade.

Cada sugestão de reunião extraída é armazenada como um objeto MeetingSuggestion na matriz. myGetMeetingSuggestions obtém dados adicionais sobre cada sugestão de reunião:

myGetMeetingSuggestions forma de uma cadeia de caracteres HTML local em htmlText para exibir os dados de cada uma das sugestões de reunião. A seguir apresentamos o código JavaScript relacionado.

// Gets instances of the MeetingSuggestion entity on the 
// message item.
function myGetMeetingSuggestions() {
    let htmlText = "";

    // Gets an array of MeetingSuggestion objects, each array 
    // element containing an instance of a meeting suggestion 
    // entity from the current item.
    const meetingsArray = _MyEntities.meetingSuggestions;

    // Iterates through each instance of a meeting suggestion.
    for (let i = 0; i < meetingsArray.length; i++) {
        // Gets the string that was identified as a meeting suggestion.
        htmlText += "MeetingString : <span>" + meetingsArray[i].meetingString + "</span><br/>";

        // Gets an array of attendees for that instance of a 
        // meeting suggestion. Each attendee is represented 
        // by an EmailUser object.
        let attendeesArray = meetingsArray[i].attendees;
        for (let j = 0; j < attendeesArray.length; j++) {
            htmlText += "Attendee : ( ";

            // Gets the displayName property of the attendee.
            htmlText += "displayName = <span>" + attendeesArray[j].displayName + "</span> , ";

            // Gets the emailAddress property of each attendee.
            // This is the SMTP address of the attendee.
            htmlText += "emailAddress = <span>" + attendeesArray[j].emailAddress + "</span>";

            htmlText += " )<br/>";
        }

        // Gets the location of the meeting suggestion.
        htmlText += "Location : <span>" + meetingsArray[i].location + "</span><br/>";

        // Gets the subject of the meeting suggestion.
        htmlText += "Subject : <span>" + meetingsArray[i].subject + "</span><br/>";

        // Gets the start time of the meeting suggestion.
        htmlText += "Start time : <span>" + meetingsArray[i].start + "</span><br/>";

        // Gets the end time of the meeting suggestion.
        htmlText += "End time : <span>" + meetingsArray[i].end + "</span><br/>";

        htmlText += "<hr/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair números de telefone

Quando o usuário clica no botão Obter Números de Telefone , o myGetPhoneNumbers manipulador de eventos obtém uma matriz de números de telefone da propriedade phoneNumbers do _MyEntities objeto, se algum tiver sido extraído. Cada número de telefone extraído é armazenado como objeto PhoneNumber na matriz. myGetPhoneNumbers obtém mais dados sobre cada número de telefone:

  • A cadeia de caracteres que representa o tipo de número de telefone, por exemplo, número de telefone residencial, na propriedade PhoneNumber.type.

  • A cadeia de caracteres que representa o número de telefone real na propriedade PhoneNumber.phoneString.

  • A cadeia de caracteres que foi originalmente identificada como o número de telefone na propriedade PhoneNumber.originalPhoneString.

myGetPhoneNumbers forma de uma cadeia de caracteres HTML local em htmlText para exibir os dados de cada um dos números de telefone. A seguir apresentamos o código JavaScript relacionado.

// Gets instances of the phone number entity on the item.
function myGetPhoneNumbers()
{
    let htmlText = "";

    // Gets an array of phone numbers. 
    // Each phone number is a PhoneNumber object.
    const phoneNumbersArray = _MyEntities.phoneNumbers;
    for (let i = 0; i < phoneNumbersArray.length; i++)
    {
        htmlText += "Phone Number : ( ";
        // Gets the type of phone number, for example, home, office.
        htmlText += "type = <span>" + phoneNumbersArray[i].type + 
           "</span> , ";

        // Gets the actual phone number represented by a string.
        htmlText += "phone string = <span>" + 
            phoneNumbersArray[i].phoneString + "</span> , ";

        // Gets the original text that was identified in the item 
        // as a phone number. 
        htmlText += "original phone string = <span>" + 
            phoneNumbersArray[i].originalPhoneString + "</span>";

        htmlText += " )<br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair sugestões de tarefa

Quando o usuário clica no botão Obter Sugestões de Tarefa , o myGetTaskSuggestions manipulador de eventos obtém uma matriz de sugestões de tarefa da propriedade taskSuggestions do _MyEntities objeto, se algum tiver sido extraído. Cada sugestão de tarefa extraída é armazenada como um objeto TaskSuggestion da matriz. myGetTaskSuggestions obtém dados adicionais sobre cada sugestão de tarefa:

myGetTaskSuggestions forma de uma cadeia de caracteres HTML local em htmlText para exibir os dados de cada sugestão de tarefa. A seguir apresentamos o código JavaScript relacionado.

// Gets instances of the task suggestion entity on the item.
function myGetTaskSuggestions()
{
    let htmlText = "";

    // Gets an array of TaskSuggestion objects, each array element 
    // containing an instance of a task suggestion entity from 
    // the current item.
    const tasksArray = _MyEntities.taskSuggestions;

    // Iterates through each instance of a task suggestion.
    for (let i = 0; i < tasksArray.length; i++)
    {
        // Gets the string that was identified as a task suggestion.
        htmlText += "TaskString : <span>" + 
           tasksArray[i].taskString + "</span><br/>";

        // Gets an array of assignees for that instance of a task 
        // suggestion. Each assignee is represented by an 
        // EmailUser object.
        let assigneesArray = tasksArray[i].assignees;
        for (let j = 0; j < assigneesArray.length; j++)
        {
            htmlText += "Assignee : ( ";
            // Gets the displayName property of the assignee.
            htmlText += "displayName = <span>" + assigneesArray[j].displayName + 
               "</span> , ";

            // Gets the emailAddress property of each assignee.
            // This is the SMTP address of the assignee.
            htmlText += "emailAddress = <span>" + assigneesArray[j].emailAddress + 
                "</span>";

            htmlText += " )<br/>";
        }

        htmlText += "<hr/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Extrair URLs

Quando o usuário clica no botão Obter URLs , o myGetUrls manipulador de eventos obtém uma matriz de URLs da propriedade urls do _MyEntities objeto, se algum tiver sido extraído. Cada URL extraída é armazenada como uma cadeia de caracteres na matriz. myGetUrls forma uma cadeia de caracteres HTML local em htmlText para exibir a lista de URLs extraídas.

// Gets instances of the URL entity on the item.
function myGetUrls()
{
    let htmlText = "";

    // Gets an array of URLs. Each URL is a string.
    const urlArray = _MyEntities.urls;
    for (let i = 0; i < urlArray.length; i++)
    {
        htmlText += "Url : <span>" + urlArray[i] + "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Limpar cadeias de caracteres de entidade exibidas

Por fim, o suplemento de entidades especifica um myClearEntitiesBox manipulador de eventos que limpa todas as cadeias de caracteres exibidas. A seguir apresentamos o código relacionado.

// Clears the div with id="entities_box".
function myClearEntitiesBox()
{
    document.getElementById("entities_box").innerHTML = "";
}

Listagem de JavaScript

A seguir apresentamos uma listagem completa da implementação do JavaScript.

// Global variables
let _Item;
let _MyEntities;

// Initializes the add-in.
Office.initialize = function () {
    const _mailbox = Office.context.mailbox;
    // Obtains the current item.
    _Item = _mailbox.item;
    // Reads all instances of supported entities from the subject 
    // and body of the current item.
    _MyEntities = _Item.getEntities();

    // Checks for the DOM to load using the jQuery ready method.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    });
}

// Clears the div with id="entities_box".
function myClearEntitiesBox()
{
    document.getElementById("entities_box").innerHTML = "";
}

// Gets instances of the Address entity on the item.
function myGetAddresses()
{
    let htmlText = "";

    // Gets an array of postal addresses. Each address is a string.
    const addressesArray = _MyEntities.addresses;
    for (let i = 0; i < addressesArray.length; i++)
    {
        htmlText += "Address : <span>" + addressesArray[i] + 
            "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

// Gets instances of the EmailAddress entity on the item.
function myGetEmailAddresses()
{
    let htmlText = "";

    // Gets an array of email addresses. Each email address is a 
    // string.
    const emailAddressesArray = _MyEntities.emailAddresses;
    for (let i = 0; i < emailAddressesArray.length; i++)
    {
        htmlText += "E-mail Address : <span>" + 
            emailAddressesArray[i] + "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

// Gets instances of the MeetingSuggestion entity on the 
// message item.
function myGetMeetingSuggestions()
{
    let htmlText = "";

    // Gets an array of MeetingSuggestion objects, each array 
    // element containing an instance of a meeting suggestion 
    // entity from the current item.
    const meetingsArray = _MyEntities.meetingSuggestions;

    // Iterates through each instance of a meeting suggestion.
    for (let i = 0; i < meetingsArray.length; i++)
    {
        // Gets the string that was identified as a meeting 
        // suggestion.
        htmlText += "MeetingString : <span>" + 
            meetingsArray[i].meetingString + "</span><br/>";

        // Gets an array of attendees for that instance of a 
        // meeting suggestion.
        // Each attendee is represented by an EmailUser object.
        let attendeesArray = meetingsArray[i].attendees;
        for (let j = 0; j < attendeesArray.length; j++)
        {
            htmlText += "Attendee : ( ";
            // Gets the displayName property of the attendee.
            htmlText += "displayName = <span>" + attendeesArray[j].displayName + 
                "</span> , ";

            // Gets the emailAddress property of each attendee.
            // This is the SMTP address of the attendee.
            htmlText += "emailAddress = <span>" + attendeesArray[j].emailAddress + 
                "</span>";

            htmlText += " )<br/>";
        }

        // Gets the location of the meeting suggestion.
        htmlText += "Location : <span>" + 
            meetingsArray[i].location + "</span><br/>";

        // Gets the subject of the meeting suggestion.
        htmlText += "Subject : <span>" + 
            meetingsArray[i].subject + "</span><br/>";

        // Gets the start time of the meeting suggestion.
        htmlText += "Start time : <span>" + 
           meetingsArray[i].start + "</span><br/>";

        // Gets the end time of the meeting suggestion.
        htmlText += "End time : <span>" + 
            meetingsArray[i].end + "</span><br/>";

        htmlText += "<hr/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

// Gets instances of the phone number entity on the item.
function myGetPhoneNumbers()
{
    let htmlText = "";

    // Gets an array of phone numbers. 
    // Each phone number is a PhoneNumber object.
    const phoneNumbersArray = _MyEntities.phoneNumbers;
    for (let i = 0; i < phoneNumbersArray.length; i++)
    {
        htmlText += "Phone Number : ( ";
        // Gets the type of phone number, for example, home, office.
        htmlText += "type = <span>" + phoneNumbersArray[i].type + 
            "</span> , ";

        // Gets the actual phone number represented by a string.
        htmlText += "phone string = <span>" + 
            phoneNumbersArray[i].phoneString + "</span> , ";

        // Gets the original text that was identified in the item 
        // as a phone number. 
        htmlText += "original phone string = <span>" + 
           phoneNumbersArray[i].originalPhoneString + "</span>";

        htmlText += " )<br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

// Gets instances of the task suggestion entity on the item.
function myGetTaskSuggestions()
{
    let htmlText = "";

    // Gets an array of TaskSuggestion objects, each array element 
    // containing an instance of a task suggestion entity from the 
    // current item.
    const tasksArray = _MyEntities.taskSuggestions;

    // Iterates through each instance of a task suggestion.
    for (let i = 0; i < tasksArray.length; i++)
    {
        // Gets the string that was identified as a task suggestion.
        htmlText += "TaskString : <span>" + 
            tasksArray[i].taskString + "</span><br/>";

        // Gets an array of assignees for that instance of a task 
        // suggestion. Each assignee is represented by an 
        // EmailUser object.
        let assigneesArray = tasksArray[i].assignees;
        for (let j = 0; j < assigneesArray.length; j++)
        {
            htmlText += "Assignee : ( ";
            // Gets the displayName property of the assignee.
            htmlText += "displayName = <span>" + assigneesArray[j].displayName + 
                "</span> , ";

            // Gets the emailAddress property of each assignee.
            // This is the SMTP address of the assignee.
            htmlText += "emailAddress = <span>" + assigneesArray[j].emailAddress + 
                "</span>";

            htmlText += " )<br/>";
        }

        htmlText += "<hr/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

// Gets instances of the URL entity on the item.
function myGetUrls()
{
    let htmlText = "";

    // Gets an array of URLs. Each URL is a string.
    const urlArray = _MyEntities.urls;
    for (let i = 0; i < urlArray.length; i++)
    {
        htmlText += "Url : <span>" + urlArray[i] + "</span><br/>";
    }

    document.getElementById("entities_box").innerHTML = htmlText;
}

Confira também