Using Google Script, how can I insert an image int

2019-08-01 12:00发布

I have been successful in figuring out how to append an image using the answer below but I need to take it one step further.

https://stackoverflow.com/a/7970134/1208721

Using Google Script in Apps, how do you specifically reference a cell in a table on a google doc and append the image there? I cannot seem to get the syntax right.

Thanks! Nate

2条回答
Lonely孤独者°
2楼-- · 2019-08-01 12:45

Continue using =image as described by Eduardo, but instead of range.setValue() use range.setFormula() Just realize you can't use this from the cell itself, like in =mycustomfunction(args) as in that case, you can only modify the cell contents of the current cell.

查看更多
倾城 Initia
3楼-- · 2019-08-01 13:00

Just set the cell formula to this one:

=Image("http://www.cardinalpath.com/cpwp/wp-content/themes/cardinalpath/images/cp_logo.png")

If you want this image to link somewhere you can even do this:

=HYPERLINK("http://www.cardinalpath.com/",Image("http://www.cardinalpath.com/cpwp/wp-content/themes/cardinalpath/images/cp_logo.png"))
查看更多
登录 后发表回答