diff --git a/samples/excel/44-shape/shape-images.yaml b/samples/excel/44-shape/shape-images.yaml index a955ab46..b70079c4 100644 --- a/samples/excel/44-shape/shape-images.yaml +++ b/samples/excel/44-shape/shape-images.yaml @@ -19,8 +19,8 @@ script: reader.onload = (event) => { Excel.run((context) => { - const startIndex = ((event.target).result).indexOf("base64,"); - const mybase64 = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const mybase64 = reader.result.toString().substr(startIndex + 7); const sheet = context.workbook.worksheets.getItem("Shapes"); const image = sheet.shapes.addImage(mybase64); image.name = "Image"; diff --git a/samples/excel/50-workbook/create-workbook.yaml b/samples/excel/50-workbook/create-workbook.yaml index 34b85bca..e5b1ea75 100644 --- a/samples/excel/50-workbook/create-workbook.yaml +++ b/samples/excel/50-workbook/create-workbook.yaml @@ -24,8 +24,8 @@ script: reader.onload = ((event) => { Excel.run(context => { // strip off the metadata before the base64-encoded string - const startIndex = (event.target).result.indexOf("base64,"); - const mybase64 = (event.target).result.substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const mybase64 = reader.result.toString().substr(startIndex + 7); Excel.createWorkbook(mybase64); return context.sync(); diff --git a/samples/excel/85-preview-apis/workbook-insert-external-worksheets.yaml b/samples/excel/85-preview-apis/workbook-insert-external-worksheets.yaml index 375e8dd6..2ae010e8 100644 --- a/samples/excel/85-preview-apis/workbook-insert-external-worksheets.yaml +++ b/samples/excel/85-preview-apis/workbook-insert-external-worksheets.yaml @@ -16,8 +16,8 @@ script: reader.onload = (event) => { Excel.run((context) => { // strip off the metadata before the base64-encoded string - const startIndex = ((event.target).result).indexOf("base64,"); - const workbookContents = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const workbookContents = reader.result.toString().substr(startIndex + 7); const sheets = context.workbook.worksheets; sheets.addFromBase64( diff --git a/samples/excel/99-just-for-fun/tetrominos.yaml b/samples/excel/99-just-for-fun/tetrominos.yaml index 06ce38b9..19ee7a37 100644 --- a/samples/excel/99-just-for-fun/tetrominos.yaml +++ b/samples/excel/99-just-for-fun/tetrominos.yaml @@ -23,8 +23,8 @@ script: const reader = new FileReader(); reader.onload = (event) => { - const startIndex = ((event.target).result).indexOf("base64,"); - const mybase64 = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const mybase64 = reader.result.toString().substr(startIndex + 7); backgroundPicture = mybase64; }; diff --git a/samples/powerpoint/basics/create-presentation.yaml b/samples/powerpoint/basics/create-presentation.yaml index 7113cca3..990e8bef 100644 --- a/samples/powerpoint/basics/create-presentation.yaml +++ b/samples/powerpoint/basics/create-presentation.yaml @@ -21,8 +21,8 @@ script: reader.onload = (event) => { // strip off the metadata before the base64-encoded string - const startIndex = ((event.target).result).indexOf("base64,"); - const copyBase64 = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const copyBase64 = reader.result.toString().substr(startIndex + 7); PowerPoint.createPresentation(copyBase64); }; diff --git a/snippet-extractor-output/snippets.yaml b/snippet-extractor-output/snippets.yaml index 2c9a2123..06fc8fd0 100644 --- a/snippet-extractor-output/snippets.yaml +++ b/snippet-extractor-output/snippets.yaml @@ -2699,8 +2699,8 @@ Excel.ShapeCollection.addImage: reader.onload = (event) => { Excel.run((context) => { - const startIndex = ((event.target).result).indexOf("base64,"); - const mybase64 = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const mybase64 = reader.result.toString().substr(startIndex + 7); const sheet = context.workbook.worksheets.getItem("Shapes"); const image = sheet.shapes.addImage(mybase64); image.name = "Image"; @@ -3276,8 +3276,8 @@ Excel.WorksheetCollection.addFromBase64: reader.onload = (event) => { Excel.run((context) => { // strip off the metadata before the base64-encoded string - const startIndex = ((event.target).result).indexOf("base64,"); - const workbookContents = ((event.target).result).substr(startIndex + 7); + const startIndex = reader.result.toString().indexOf("base64,"); + const workbookContents = reader.result.toString().substr(startIndex + 7); const sheets = context.workbook.worksheets; sheets.addFromBase64(