Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit in Word using Wopi and Office Online Server

I am working on a project where we have implemented content management with word. We have some word files, that are being processed using OpenXML. Users can open those files in two ways - download a copy or edit online. Online editing is implemented using Office Online Server and custom Wopi server, built based on this example.

Editing online works fine, but Word Online has limited features compared to desktop Word.

I am trying to build a functionality similar to Sharepoint, where user has 2 options - Edit in Word, Edit in Browser: Sharepoint Word edit options

In Office Online Server I don't have such options, I can only edit in browser: OOS Word edit options

Even in edit mode Sharepoint provides a link for Edit in Word: Sharepoint in edit mode

whereas Office Online Server does not have it: OOS in edit mode

My question is how it is implemented in Sharepoint? In other words, am I missing something in Wopi server to enable it or Microsoft has built this functionality into Sharepoint, without the need of Wopi and/or OWA?

Any ideas would be appreciated!

like image 889
Evaldas Dzimanavicius Avatar asked May 17 '16 12:05

Evaldas Dzimanavicius


People also ask

Can I edit a Word document on Word online?

Click Edit Document > Edit in Word for the web to make changes to a document. When you open a document from OneDrive, Word for the web displays it in Reading view. To make changes to your document, switch to Editing view, where you can add and delete content and do other things, such as: Add tables and pictures.

What is Office Online server used for?

Office Online Server is an Office server product that provides browser-based file viewing and editing services for Office files. Office Online Server works with products and services that support WOPI, the Web app Open Platform Interface protocol.

How do I import a Word document into office online?

In the Documents area, click New Document and then click Upload Existing File. Tips: You can also drag or drop files or save directly to your team site or OneDrive for Business from Office.


2 Answers

To enable "Edit in Word" in Office Online Server when using a WOPI handler, you need to set the ClientUrl property in CheckFileInfo (and CheckFolderInfo if you implement that). ClientUrl should be set to a direct editable link for the document file, either WebDAV or FSHTTP, but you could even use a file:// link for testing.

When you set the ClientUrl property, Office Online behavior becomes very similar to OneDrive/SharePoint Online. The current WOPI documentation is a bit outdated, it lists this property under Unused and future properties, but there is nothing secret about it. I asked [email protected], that is Microsoft's "Open Specifications Support" mailbox, mentioned in many of their presentations and publications about WOPI and Office Online.

Word Online Reading View:

Edit Document menu in Reading View

Word Online Editing View after clicking OPEN IN WORD: 'Open in Word' menu behavior

like image 90
Berend Engelbrecht Avatar answered Sep 21 '22 12:09

Berend Engelbrecht


I'm pretty sure that the functionality (Edit in Word) is not part of the Office Online Server and that it doesn't utilize the WOPI protocol. In the previous versions of SharePoint, it was implemented using WebDAV and I guess this hasn't changed. If you want to support opening/editing/saving you should implement your own WebDAV server. You can save a lot of time if you use a pre-built server like one from ITHit. They also have a JS framework to support opening files from browser.

If you want a cheap, cross-browser alternative that will just invoke the editing apps I suggest you have a look at Office URIs.

like image 41
rocky Avatar answered Sep 17 '22 12:09

rocky