Skip to content

Instantly share code, notes, and snippets.

@davecra
Created July 6, 2024 04:25
Show Gist options
  • Save davecra/2373d370ff0731748f6dc1081302f59d to your computer and use it in GitHub Desktop.
Save davecra/2373d370ff0731748f6dc1081302f59d to your computer and use it in GitHub Desktop.
Demonstrates how to use OutlookEmailBodyParser
const emailBody = new Promise((resolve, reject) => {
try {
Office.context.mailbox.item.body.getAsync(type, (result) => {
if (result.status === Office.AsyncResultStatus.Succeeded) {
resolve(result.value);
} else {
reject(result.error);
}
});
} catch {
reject("Unable to get email body text.");
}
});
const parser = new OutlookEmailBodyParser(emailBody);
return parser.getLatestResponse();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment