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
651 stars 92 forks source link

Word close API not working #4578

Open ishanig11 opened 2 weeks ago

ishanig11 commented 2 weeks ago

Hi,

I am using following code to close document from online Word. await Word.run(async (context) => { context.document.close(); });

But document is not getting closed. Also I checked if environment support requirement set. Office.context.requirements.isSetSupported('WordApi', 1.5) , this value is true.

So it should work. Can you please tell me if I am missing anything,

shanshanzheng-dev commented 1 week ago

Hi @ishanig11 Thanks for reporting this issue. This is a by-design behavior. There's no close action on Word Online. We recommend you to upvote or submit a new Tech Community New Ideas item, this will give us visibility of the commonality of it and will help with our prioritization. If we end up working on this issue, we will re-activate as needed.    Microsoft 365 Developer Platform - Microsoft Community Hub

ishanig11 commented 1 week ago

As per documentation its available on WordApi 1.5 requirement set. And this is supported for online version also.

shanshanzheng-dev commented 5 days ago

Hi @ishanig11 Thanks for reaching out. I think you mean this documentation, right? https://learn.microsoft.com/en-us/javascript/api/word/word.document?view=word-js-preview#word-word-document-close-member(1) For this close api, it only works on word desktop, it not work on word online. Sorry for the confusion. Again, you can submit your request on Tech Community New Ideas item, we value your feedback. Thanks.

ElizabethSamuel-MSFT commented 4 days ago

@ishanig11 We're updating the documentation to note that Word on the web isn't supported. That change should be live tomorrow (June 24) Pacific Time.

Thanks.

microsoft-github-policy-service[bot] commented 8 hours ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!