Inserting OoXml into word throwing Error: Unknown

拟墨画扇 提交于 2019-12-09 19:26:03

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/52097263/inserting-ooxml-into-word-throwing-error-unknown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!