Discerning whether a document is in "Editing", "Reviewing" or "Viewing" mode via Word/Excel JS API

Discerning whether a document is in "Editing", "Reviewing" or "Viewing" mode via Word/Excel JS API
13

Upvotes

Upvote

 Nov 17 2023
0 Comments 
New

Since May 2022 Word users have been able to switch between "Editing", "Reviewing" and "Viewing mode on a document (announcement blog post).

 

However, there is no way for a Word add-in to detect then mode a user is in. Word.Document.changeTrackingMode returns whether tracked changes are enabled, and is useful for discerning whether the document is in "Editing" or "Reviewing" mode, but it does not cover the case where it is in "Viewing" mode (in my testing it returns the same value when in "Reviewing" and "Viewing" modes).

 

It would be good for add-ins to have a way to detect whether a user is in "Viewing" mode. Doing so would allow us to disable some functionality in that case, and indicate to the user why it's disabled.

 

The same is also true for Excel, and probably applies to PowerPoint, too.