user12791973
user12791973

Reputation:

Is it possible to intercept events on Office.js?

I'm new to Office.js and I wanted to know if is possible to intercept when user saves the document, opens it, prints it, etc. And if it is, how do I do it?

Upvotes: 1

Views: 390

Answers (1)

Raymond Lu
Raymond Lu

Reputation: 2236

For open the add-in, you could use

Office.onReady();
{
  Excel.run(async (context) => {
    let sheets = context.workbook.worksheets;
    // your code logic here
    console.log("Start");
    await context.sync();
  });
}

So far we dont have onSaved events, as we have autosave feature, the document will be autosaved. So we decide not to provide onSaved event.

Upvotes: 1

Related Questions