在电子邮件Google应用程序脚本中发送多个工作表范围数据,可以通过以下步骤实现:
var sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2");
var data1 = sheet1.getDataRange().getValues();
var htmlBody = "<h1>Sheet1 Data:</h1>";
htmlBody += "<table>";
for (var i = 0; i < data1.length; i++) {
htmlBody += "<tr>";
for (var j = 0; j < data1[i].length; j++) {
htmlBody += "<td>" + data1[i][j] + "</td>";
}
htmlBody += "</tr>";
}
htmlBody += "</table>";
MailApp.sendEmail({
to: "recipient@example.com",
subject: "Multiple Sheets Data",
body: htmlBody,
htmlBody: htmlBody
});
这样,你就可以在电子邮件Google应用程序脚本中发送多个工作表范围数据了。
腾讯云相关产品介绍链接地址:
领取专属 10元无门槛券
手把手带您无忧上云