"For the first time we are opening up Office 365 not just as an end-user and an enterprise tool and a service, but as a developer platform," said Microsoft CEO Satya Nadella during the earnings call following the company's latest financial results.
Despite Nadella's comment the ability to develop for Office 365 is not new, though it is significantly enhanced following announcements at the Microsoft Build developer conference at the end of March 2016. For Microsoft though, there is strategic sense in promoting Office as a web platform, adding value for those customers who sign up to Office 365.
What is Microsoft Office? The answer used to be Word, Excel, Outlook, PowerPoint, and a bunch of other more specialist applications like Access, Publisher, Project and Visio, all of which ran best on the Windows desktop and some of which were also available on the Mac.
Today Microsoft means something different, especially in the context of Office as a platform. Office 365 is built around hosted Exchange, SharePoint, and the directory service called Azure Active Directory. It is the obvious destination for businesses tired of running their own Exchange server, and while Google and more recently Amazon are grabbing some of that market, plenty is also going Microsoft's way. According to figures presented at Build, there are over 50,000 new Office 365 small businesses per month.
There are still a ton of Microsoft Office users who do not use Office 365, or even on-premises Exchange and SharePoint, but only a subset of the "Office platform" is available to them. That said, there is an option for individuals to use personal Outlook.com and OneDrive as a kind of lite version of Office 365, and one of the announcements at Build was about a new unified API for business and personal users.
This increasing cloud-dependency is not just Microsoft's attempt to hook more users into its web platform, but also a reflection of the greater potential for integrating services (both from Microsoft and from third-parties) which a cloud platform offers.
Web add-ins for Office applications
Preamble over, what does the Office platform now look like? The starting point is the application suite itself, which now runs tolerably well on iOS and Android as well as Mac and Windows. There is also a Universal version, for Windows 10 in all its forms (including even HoloLens augmented reality headsets).
Office on Windows still supports old-style extensibility via Visual Basic for Applications (VBA), COM add-ins and more; but since Office 2013 Microsoft has been pushing developers towards a new web-based add-in model. This type of add-in is essentially a web application, hosted anywhere, that is surfaced in an Office application and can interact with it via JavaScript libraries. These add-ins can have a user interface via a "task pane" in some Office applications.
Web add-ins in Office 2013 were hampered by a limited API, but in Office 2016 this is greatly extended. Web add-ins are also now supported in Office online, Office for iPad and Office for Mac, with Android and universal compatibility promised.
Microsoft's cloud services are not required to run these add-ins. All you need is an XML manifest and a web application hosted somewhere. That said, a neat feature announced at Build is the ability to deploy add-ins automatically to Office 365 users. Administrators can go to the shiny new Office 365 portal (still in preview), upload the manifest for an add-in, specify users or groups to use it, and it will automatically appear for those users.
In keeping with Microsoft's cross-platform push, you can develop Office add-ins on Linux or on the Mac as well as with Visual Studio. Just install TypeScript, Bower, Gulp and Yeoman, and type "yo office" to generate an add-in ready for modification.
What can these add-ins do? On the web side, anything you want. On the Office side, the latest APIs, documented here, will look familiar to those who have worked with a document object model, whether in Office or JavaScript. Add-ins have read-write access to documents, and in Word and Excel can bind to document elements for two-way updates. In the latest update, add-ins can also add tabs, buttons or other controls to the Office Ribbon.
These are web add-ins, though, and as such have limited ability to interact with the local machine. Old-style VBAs or other solutions are still needed if you want to interact with local files or devices, though it is possible to retrieve an open document as a binary string and send it to a remote location such as OneDrive storage.
Another limitation of web add-ins is lack of event support, other than the binding mentioned above. You cannot write code that runs in response to events like opening or saving a document, for example.
The Microsoft Graph
If you are developing for Office 365, the Microsoft Graph is a big deal. Despite the confusing name, it is different from the Office Graph, which is a Facebook-like analysis of relationships within an organisation. The Microsoft Graph is a REST API endpoint through which you have programmatic access to numerous Office 365 services, including OneDrive documents, users and groups, email, tasks, contacts and notes. SDKs are available for .NET, JavaScript, iOS and Android, PHP and more.
Now in preview is a new REST API for Excel, which lets you programmatically edit Excel documents in OneDrive. You could generate financial summaries automatically, complete with tables and charts.
Another key feature is Webhooks, for which general availability was announced at Build. A Webhook enables developers to set up subscriptions so that their web service gets called whenever certain changes take place, such as when email is received, or new calendar events are created.
Another Build announcement was that Microsoft Graph APIs will now work with consumer as well as business services, making it possible to create applications that work for individuals with a Microsoft account rather than an Office 365 account.
The Microsoft Graph is not new. It was previously called the Office 365 Unified API. In addition, service-specific REST APIs also exist at different endpoints. A unified endpoint is easier for developers though, simplifying authentication, and the Microsoft Graph is intended to be the way forward as new APIs are added.
Conversations
At Build, Microsoft made a big deal of "conversations" in the context of Office development. This is not about talkative bots, but rather about Outlook groups in Office 365. These are nothing more (or less) than a new take on forums and mailing lists. Groups can host discussions and have their own files and calendar. The developer aspect comes mainly from a feature called Connectors, which let groups interact with other services. These are subscriptions, so you can write applications that send "Connector card" messages to Outlook groups, perhaps including images and hyperlinks.
Ready for prime time?
Many users spend much of their time in Office, and automating common tasks or integrating other services into Office makes sense as a well of boosting productivity. An example shown at Build was a clause builder for legal departments, with a database of common clauses held online and a Word add-in for inserting them into documents. The web-based, cross-platform approach which Microsoft now follows is the only one that adds up, given the long-term decline in the PC market and the company's poor showing in mobile.
That said, progress is painfully slow. Long-term Office developers remain frustrated by the limitations of the web add-in model versus what can be done in VBA or with COM. Office on iOS is now supported to some extent, but not yet on Android. Documentation and support for the complex Microsoft Graph APIs is patchy, and there is a sense that development on Office 365 as a platform has yet to take off.
Businesses should also think carefully about the implications of building custom applications for Office 365, which increases their lock-in to the Microsoft platform, albeit in its new more open guise.
On the plus side, if Microsoft continues to hammer its Office developer APIs and support into shape, there is plenty of potential for compelling solutions. The Office dev center is
hereSources: theregister.co.uk, Microsoft, dev.office.com