Using WOPI To Embed Microsoft Office In Your Web App (Part 1)

Web Application Development

Are you thinking about harnessing the capabilities of Office Online (Office Online Server or Office 365) to enhance your web Application by embedding Word, Excel, Powerpoint? This is the first in a series of blog posts relating to embedding Microsoft Office document editing capability using WOPI (Web Application Open Platform Interface) in bespoke web Applications. In this post, we’ll give you some guidance on getting set up for WOPI Microsoft development, where to find documentation and what WOPI is. In the next few posts, we’ll be exploring a working WOPI application and seeing how it all fits together.

Common Uses

Common uses of this technique are that the web App you are developing allows users to store and edit Microsoft Office documents. For example, you could be engaged in web App development for software that tracks development of engineering components. The components could have data sheets that are being collaboratively written using Word and technical calculations that are being developed using Excel. Rather than kicking users out of your web Application to deal with edit these documents and having your users manually upload and download them to/from your software, you could embed Office Online Word and Excel edits inside your applications.

Using Wopi to Embed Microsoft Office

Getting Started With WOPI

To get going with this process, you are going to need your usual development environment (e.g. Visual Studio) and access to Office Online. Access to Office Online is either typically through Office 365 (hosted by Microsoft) or by an on-premise install of Office Online Server. If you are going to use the Office 365 approach, then you will need to enrol in the “Office 365 – Cloud Storage Partner Program“. If you are developing for Office Online Server, you don’t need to do this.

Indeed, getting a development environment and a simple testable product setup quickly is easier with Office Online Server. The simplest way to get a copy of Office Online Server is to organise yourself an MSDN subscription. If you’re reading this, then chances are that you are already interested in web App development and you already have an MSDN subscription. If you want to develop using Office 365 then you have to get some endpoints registered with Microsoft and jump through some other hoops (I’ll document these in a later post) which can take a little while.

The next thing you are going to need is access to the WOPI documentation. The good news is that it is freely available here. The bad news is that it is incomplete, inconsistent, vague and inaccurate, which is why we have started this blog series.


What Is WOPI?

WOPI refers to a sequence of operations that allows a user to gain access and change files and data stored within a server. As a REST-based protocol, in order for the process to work HTTP requests need to be sent to a set of defined operations and REST endpoints. Therefore, in order to embed web-based Office document editing in your web application, WOPIM must be developed as a RESTful web API for implementation. You don’t need to implement the whole protocol. You only need to implement the methods of the protocol that are required for your web application.

In the simplest scenario, you just need to implement a few methods to embed a read-only Word editor in your web application. This is both easier and harder than it sounds. It’s easier because it’s just a simple API implementation, it’s harder because the documentation for that implementation is so poor and lacks a complete working example.

What’s Next?

In our next post, we will explain how you set up your host iframe to hold the Office 365 editor for your web application and we will explain some of the underlying concepts of WOPI that you need to get you started.

If you don’t have the in-house skills or time to develop your own WOPI Microsoft web application solution, then please contact McKenna Consultants for a free consultation!

Nick McKenna
Since 2004, Nick McKenna, BSc, MBCS Biography has been the CEO of McKenna Consultants. McKenna Consultants is a bespoke software development based in North Yorkshire, specialising in Cloud development, mobile App development, progressive web App development, systems integration and the Internet of Things development. Nick also holds a First Class Degree in Computer Science (BSc) and wrote his first computer program at the age of nine, on a BBC Micro Model B computer. For the last 21 years, Nick has been a professional computer programmer and software architecture. Nick’s technical expertise includes; Net Core, C#, Microsoft Azure, Asp.Net, RESTful web services, eProcurement, Swift, iOS mobile development, Java, Android mobile development, C++, Internet Of Things and more. In addition, Nick is experienced in Agile coaching, training and consultancy, applying modern Agile management techniques to marketing and running McKenna Consultants, as well as the development of software for clients. Nick is a Certified Enterprise Coach (Scrum Alliance), SAFe Program Consultant (SAI), Certified LeSS Practitioner (LeSS) and Certified [email protected] Practitioner. Outside the office, Nick is a professional scuba diver and he holds the rank of Black Belt 5th Dan in Karate.