Created
July 6, 2024 04:25
-
-
Save davecra/2373d370ff0731748f6dc1081302f59d to your computer and use it in GitHub Desktop.
Demonstrates how to use OutlookEmailBodyParser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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