3

I have a custom task pane for Outlook 2016 written in JavaScript and HTML. I am currently calling an API and passing the email address to get some data back. I then display this data in the Task Pane inside Outlook.

After searching for a solution and being unsuccessful due to the lack of support of this fairly new concept my question is, how can I keep this Task Pane open at all times? as it currently closes when you open another email.

Here is my JavaScript Code for finding the email Address and adding the data:

 Office.initialize = function (reason)
{
    $(document).ready(function ()
    {
        app.initialize();
        var emailData = Office.context.mailbox.item;
        var emailAddress = emailData.from.emailAddress;

        populateTaskPane(emailAddress);
    });
};

function populateTaskPane(emailAddress)
{
    var url = "https://myapi.com/GetDataFromEmail?emailAddress=" + emailAddress;

    $.ajax({
        headers: { "Accept": "application/json"},
        type: 'GET',
        url: url,
        crossDomain: true,
    })
        .success(function (data) 
        {
           buildPage(data);
        });
}

Not sure if this will be helpful but included just in case.

Samuel Pearsall
  • 255
  • 1
  • 4
  • 11

1 Answers1

1

I think you can't have a Task Pane "opened by default". Every add in must be launch by the user.

  • Thanks for the answer, although I have looked at some Add-ins on the Office Store, and the SalesForce add-in, for example, stays open when the user switches emails, after it as been launched by the user, so I do think it would be possible. – Samuel Pearsall Dec 10 '15 at 11:38