Open rahul-chanana opened 1 day ago
Hi @rahul-chanana, thx for your submit. The excel has a feature called worksheet protection. Is this what you want? https://learn.microsoft.com/en-us/javascript/api/excel/excel.worksheetprotection?view=excel-js-preview
Hi @RuizhiSunMS,
Thanks for your reply. I’ve tested the worksheet protection, and it’s working well. We now need similar APIs for Word and Powerpoint as well. Is there any way to achieve this functionality in Word and Powerpoint as well?
Hi @RuizhiSunMS,
Thanks for your reply. I’ve tested the worksheet protection, and it’s working well. We now need similar APIs for Word and Powerpoint as well. Is there any way to achieve this functionality in Word and Powerpoint as well?
I'm investigating.
@rahul-chanana -
Currently, the Office JavaScript API does not provide a direct method to disable document editing or set a PowerPoint presentation to read-only model.
However, you might consider alternative approaches, such as:
If you'd like to request a feature - please make the request here Microsoft 365 Developer Platform Ideas Forum. Feature requests on are considered when we go through our planning process. Thanks for highlighting this!
Hello,
We are developing an Office Add-In (Taskpane) using the Angular framework and are looking for a way to set the document to read-only or disable editing using the Office JavaScript API. Our Add-In performs logic that may take a significant amount of time, and we are seeking a method to lock the document during this process.
We couldn't find any equivalent methods in the available APIs. Is there any way to achieve this?
Thank you in advance for your help!
Expected Behavior
We would like to disable editing of the document temporarily using the Office JavaScript API and enable editing again once the process is complete.
Current Behavior
There doesn't seem to be a method available in the API to disable editing of the document.
Context
We need to perform long-running logic in the add-in, and during this time, we need to disable editing of the document.
Your Environment