2

I am developing a Word Online add-in that is supposed to operate in an environment with a custom WOPI host. We faced issues with a certain Office JS API which appears not to be supported on the WOPI host side. But we are struggling with identifying what exactly is missing.

Could anyone please help me to figure out what WOPI API needs to be implemented in order to support insertOoxml OfficeJs API call with insertLocation set to "Replace"?

What the sequence of calls to the WOPI host would be in this case?

The code is pretty simple and works as expected with SharePoint as a WOPI Host.

Word.run(function (context) {
   var body = context.document.body;
   body.insertOoxml(ooxmlDoc, "Replace");
   return context.sync().then(function () {
   q.resolve();
 });
})

RichApi.Error screenshot

Unfortunately, I have very limited access to the WOPI host codebase to understand the root cause.

Any ideas are highly appreciated!

rocky
  • 7,506
  • 3
  • 33
  • 48
Alex Look
  • 61
  • 2
  • What have you tried so far? Please provide code samples or links to your code with examples of your "insertOoxml" OfficeJS API implementation attempts. Without knowing exactly what you are trying to achieve, it's very difficult to answer your question. – Doomd Jul 22 '20 at 09:45
  • I raised a bug report for this last year (https://github.com/OfficeDev/office-js/issues/2893). No sign of a fix yet. My workaround was to use insertHtml(...) and then fix the formatting issues. – Nick McKenna Jan 23 '23 at 10:15

1 Answers1

0

Can you fetch the CheckFileInfo of your WOPI host?

You need to make a GET request to /wopi/files/(file_id) with the right access_token. Then check the WOPI Capabilities, especially things like:

rocky
  • 7,506
  • 3
  • 33
  • 48