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.