I am trying to insert file which is formatted as Base64 using insertFileFromBase64()
but I am getting this exception:
{
"name": "OfficeExtension.Error",
"code": "GeneralException",
"message": "ooxmlIsMalformated",
"traceMessages": [],
"innerError": null,
"debugInfo": {
"code": "GeneralException",
"message": "ooxmlIsMalformated",
"errorLocation": "Body.insertFileFromBase64"
}
}
My code is:
// documentData - is a base64 string.
// Encoded base64 string = "V29yZCBEb2N1bWVudCBpcyBub3QgZ2V0IGluc2VydGVkIHVzaW5nIGluc2VydEZpbGVCYXNlNjQ="
body.insertFileFromBase64(documentData,window.Word.InsertLocation.replace);
I have tried other methods for HTML and text that are working, but getting the exception with insertFileFromBase64
.
Can someone please guide me if I am missing anything here?