3

I've been attempting to insert OOXML into the body content of word documents via the office-js insertOoXML() method. I've even tried the simplest of implementations (thinking I was doing something incorrect when attempting to replace fieldCodes in the XML itself) and all result in this Error: unknown response after saying its "inserting":

Error: unknown at new r (word-web-16.00.js:21) at i.c.processRequestExecutorResponseMessage (word-web-16.00.js:21) at word-web-16.00.js:21

To reproduce - here's a simple example of getting the body OoXML and attempting to replace it back in:

Word.run(async context => {
  const OOXML = context.document.body.getOoxml();
  await context.sync();
  context.document.body.insertOoxml(OOXML.value, Word.InsertLocation.replace);
  await context.sync().catch(console.error);
});

With the example above there is no chance that the OoXML is malformed as it's the direct result that office-js has returned to the client.

Any help with this would be much appreciated as manipulating Field Codes (as there's no native support) is a must for my Add-In.

6
  • Can you please clarify in what platform you are experiencing his?i am assuming Word Online ? What about in windows ? Also it’s important to understand what content is in the document. Commented Aug 30, 2018 at 13:44
  • @JuanBalmori Sure thing. I'm using Word 2016 on Mac, and Word online on Chrome, also on Safari (Mac Sierra). Same issue across the board. The content of the document is a blank document with one paragraph which says 'Hello World'. Unfortunately I don't have a windows machine to test on - will need to test my on my VM. Commented Aug 30, 2018 at 14:38
  • @JuanBalmori Mistake - Word 2016 on Mac is fine (sorry - it's awkward to debug on sierra). It's the online versions which break. Commented Aug 30, 2018 at 14:50
  • 1
    @JuanBalmori This was also reported a day or so ago: stackoverflow.com/questions/52092107/… Commented Aug 31, 2018 at 5:09
  • 1
    We are encountering this same problem, a few days ago this still worked. Haven't found a solution... Commented Aug 31, 2018 at 9:44

1 Answer 1

3

InsertOoxml is now working as it should for me.

Microsoft appears to have fixed this problem (Although I have not yet had official confirmation via my support case)

Thanks to Juan Balmori and those working on the extensibility team for getting this fixed up.

J.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for confirming this!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.