i want to know if there is any API/function which can be used to detect if office document is read-only. I am creating an office add-in using office.js library. the document is shared to other user in readonly mode. if i use following property, it shows readWrite but actually document is in readonly mode. following property is not helping
var docMode = Office.context.document.mode; // did not work, it gives value of manifest file i guess
I am trying following thing, it worked but not sure if that is the right approach. if the file is in one drive it give url as http://d.doc.onedrive..something like this.
if (Office.context.document.url.indexOf("https://excel.officeapps.live.com") > -1) {// its in read-only mode-this is the unique folder name where the file is
$("#container").show();
$("#readOnlyArea").show();
} else {
$("#mainArea").show();}
Office.context.document.mode
are for both read-write and read-only documents? – Michael Zlatkovsky - Microsoft