Method for determing which Office Application an Add-In is running in
Currently, an Add-In can be setup to be runnable in Excel, Word, PowerPoint, etc...
There are certain API features that are available to some of the Office Applications but not others; In addition, the availability of these features differ based on platform (fat clients, web, ipad, etc...). As such, we may choose to use TableData for an Add-In that is loaded in Excel, but HTML for the same Add-In loaded in Word.
Right now, we use the context.document.url property to determine the application, looking for the ",xls" extension in it.It's not a complete solution but it is getting us by for now.
What would be fantastic would be to have an explicit property in the API, such as context.hostOfficeApplication that would tell the app which Office application it is running in.
Hi Paul, thank you for the suggestion. This information is already available on the API. There’s more information in the documentation at: https://github.com/OfficeDev/office-js-docs/blob/master/reference/shared/context.md
Office Extensibility Team