我有一个带有脚本的google工作表,该脚本以Excel格式发送附件中的工作表。我的一列是图片,是否可以在.XLS中添加它?列的图像保持空白。
function sendEmail() {
var ssID = SpreadsheetApp.getActiveSpreadsheet().getId();
var sheetName = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("name_of_sheet_to_send");
//var email = Session.getUser().getEmail();
var email_ID1 = "email@email1";
var subject = "Dates de livraisons erronées";
var body = "Hello! Ci-joint la liste des refs dont la date de livraison est antérieure à la date de livraison possible. Happy birthday! (Coeur avec les mans) ";
var requestData = {"method": "GET", "headers":{"Authorization":"Bearer "+ScriptApp.getOAuthToken()}};
var shID = "xxxxxxxx";
var url = "https://docs.google.com/spreadsheets/d/"+ ssID + "/export?format=xlsx&id="+ssID+"&gid="+shID;
var result = UrlFetchApp.fetch(url , requestData);
var contents = result.getContent();
MailApp.sendEmail(email_ID1,subject , body, {attachments:[{fileName:sheetName+".xls", content:contents, mimeType:"application//xls"}]});