I started to dive in to the JavaScript API for Office. To get a starting point I started with Word as I’m very familiar with what is there already for VBA and VSTO and will allow me to give me a good starting point to compare.
The first thing you find when you start looking at the JavaScript API for Office is that there are two JavaScript Object models:
· Common APIs
· Host-specific
The Common APIs were introduced with Office 2013 and allows you to connect your add-in application with the Office client application. The object model has Office client specific APIs and APIs that target multiple Office host applications.
This is part of the Shared API and with this API you can interact with the content in Office documents (documents as in Documents, Worksheets, Presentations, Mail Items or Projects). With this API you can target Office 2013 and later. The Shared API is using the common API syntax and the object model used in this API uses callbacks.
Then there are the Host-specific APIs. These APIs were introduced with Office 2016. These APIs provide object models that are host-specific (duh-uh) but more important for stable software development: strongly typed objects that allow you to get some Intellisense in your development toolset.
The different API sets are a bit confusing and the documentation is not all that clear for you to find what is used by what host-application or that is using the Common API. There is a nice overview page that allows you to click on each host application and immediately showing you what API is supported:
Source: https://dev.office.com/add-in-availability
If you click on the details for Outlook for instance there are however Mailbox 1.0 to Mailbox 1.5 in the list but unlike the details for instance for Word or Excel these links are no hyperlinks so you are on your own with this (or maybe there just are no online references?)
Also, the references for Project or Access are not in the list at all. These are linked back to the Office common API requirement sets
I think you agree with me that this doesn’t make it all to clear, especially if you come from VBA or even VSTO. I’m not sure how you could document this better, I need more insights first to think about that. Next target will be to try to understand more about what is used where and when. One thing is relatively clear so far: You need to determine first what your target audience is. The host-specific APIs only target Office 2016 (and up?) to name one … decisions, decisions, decisions.
To be continued …
2 Replies to “Office Development – API Confusion”