Long operations crash Office addin (JS)
问题 I just created a (JS) Word Add-in and found that long synchronous operations can make it crash. In these cases, the following error is displayed - [ADD-IN ERROR Sorry, we had to restart because this add-in wasn't responding.] The following code is ran on a button click. function scanText() { Word.run(function (context) { var body = context.document.body; context.load(body, 'text'); return context.sync().then(function () { var r = thisOperationCanTakeALongTimeIfDocIsLarge(body.text); }); })