I am trying to create a mobile add-in with Office.js and I am using OnNewMessageCompose event.
10 second after event launched, I am trying to get body with the code below but it doesnt work.
async function getEmailBody() {
return new Promise((resolve) => {
setTimeout(() => {
Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html, function (asyncResult) {
if (asyncResult.status == "failed") {
resolve(null);
} else {
resolve(asyncResult.value);
}
});
});
}, 10 * 1000);
}
async function newMessageCompose(event) {
await getEmailBody()
event.completed();
}
It immidiatly goes error and mail body has value its not empty. It Work with Web and Desktop application but not with mobile