question

SalazarJaime-4114 avatar image
0 Votes"
SalazarJaime-4114 asked SalazarJaime-4114 commented

Office script to copy table image copies 'wrong' format

Hi,

I'm not sure if this is the place to report what I think is a bug in a function. In Power Automate, I am copying a table image from an Excel file into the body of an email. In order to do that, I have used the script I found here: https://docs.microsoft.com/en-us/office/dev/scripts/resources/samples/email-images-chart-table

Specifically, under the section for Sample code: Calculate and extract Excel chart and table, I'm finding the line const tableImage = table.getRange().getImage();.

The Excel file contains the cells B9 and G9 where the text is properly wrapped:
131018-correct.jpg

However, this gets copied into the email body with what appears to be unwrapped text:
131091-incorrect.jpg

Is there something I can add to my script to keep the original, correct formatting? Or is this a bug in the Range.getImage() function?


Thank you



office-scripts-excel-dev
correct.jpg (43.3 KiB)
incorrect.jpg (38.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlexJerabek avatar image
1 Vote"
AlexJerabek answered SalazarJaime-4114 commented

Hi @SalazarJaime-4114 ,

Thank you for reporting this issue. This does appear to be a bug in the Excel for the web implementation of this API (which affects Office Scripts). We are investigating a fix.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for confirming this!

0 Votes 0 ·