I have used following code for parsing Word document in an office app
var currentSlice = currentFile.getSliceAsync(0, function (resultSlice) {
if (result.status == Office.AsyncResultStatus.Succeeded) {
//We got the file slice. Now we will encode the data and post to a service
var documentText = OSF.OUtil.encodeBase64(resultSlice.value);
// Open the document, which is stored as a base64 string.
var doc = new openXml.OpenXmlPackage(documentText);
}
}
this works for Word 2013 but following line
OSF.OUtil.encodeBase64(resultSlice.value);
throws exception
Object doesn't support property or method 'charCodeAt'
on Word 2016.
Any idea about what are possible reasons?
Note i have used the latest Office.js from https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js
Regards, Jhan Zaib