Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function signReports() {
- var folderId = '<<PUT THE ID OF YOUR FOLDER WITH DOCS TO APPEND IMAGES TO>>';
- var imageId = '<<PUT THE ID OF THE IMAGE TO APPEND HERE>>';
- var files = DriveApp.getFolderById(folderId).getFilesByType(MimeType.GOOGLE_DOCS);
- while(files.hasNext()) {
- var file = files.next();
- var doc = DocumentApp.openById(file.getId());
- var image = DriveApp.getFileById(imageId);
- doc.getBody().appendImage(image).setWidth(doc.getBody().getPageWidth());
- }
- }
Add Comment
Please, Sign In to add comment