Reputation: 43
I am trying to insert an image into a Google Slide using an App script. I have:
SlidesApp.getActivePresentation().insertImage('');
I get error insertPicture (Code:18)
Upvotes: 0
Views: 1303
Reputation: 465
Review the Google documentation for inserting images.
First off, insertImage
must be called on a specific slide, not a specific presentation. It needs to know where to put the image.
Secondly, the content of insertImage can't be empty like that. It needs to be a url, blob, etc.
For example, try some code like this:
var slide = SlidesApp.getActivePresentation().getSlides()[0];
slide.insertImage('https://upload.wikimedia.org/wikipedia/commons/5/56/Wiki_Eagle_Public_Domain.png');
Upvotes: 3