OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
688 stars 95 forks source link

Capture document closure #5072

Open rahul-chanana opened 1 week ago

rahul-chanana commented 1 week ago

Hello,

We are developing an Office Add-In (Taskpane) using the Angular framework and need to execute specific logic before a document is closed. In certain scenarios, we may need to prevent the document from closing.

Is there any event available to capture the document closure, or is there any another way to achieve this?

Any assistance would be greatly appreciated.

Thank you in advance for your help!

Expected Behavior

An event that we can capture when the user presses the close button.

Current Behavior

I could not find any event in the API to capture document closure.

Context

I need to perform certain logic before the document is closed or possibly prevent the document from closing in specific cases.

Your Environment

RuizhiSunMS commented 1 week ago

hi @rahul-chanana, thx for your submit. Would you please provide some details (platform for example). In general, filling the issue template of this channel is recommended so that we can do investigation better. Thx.

rahul-chanana commented 1 week ago

Hi @RuizhiSunMS,

I updated my question using the default template. I hope it helps.

RuizhiSunMS commented 1 week ago

As far as I know, we don't have such feature. I'll reach out to feature crew to double confirm. Put it into our backlog as #9528001.