function myfunk() {
const ss = SpreadsheetApp.getActive();
const doc = DocumentApp.create("Sample");
const sh = ss.getSheetByName("Sheet1");
const vs = sh.getRange("A2:F10").getValues();
doc.getBody().appendTable(vs);
doc.getBlob().getAs('application/pdf');
doc.saveAndClose();
GmailApp.sendEmail("[email protected],"Data your looking for","Hi Bob: Here it is",{attachments:[doc]});
}
Save table in doc and send it
function myfunk() {
const ss = SpreadsheetApp.getActive();
const doc = DocumentApp.create("Sample");
const sh = ss.getSheetByName("Sheet1");
const vs = sh.getRange("A2:F10").getValues();
doc.getBody().appendTable(vs);
doc.getBlob().getAs('application/pdf');
doc.saveAndClose();
GmailApp.sendEmail("[email protected],"Data your looking for","Hi Bob: Here it is",{attachments:[doc]});
}
发布评论
评论(1)
将表格保存在 doc 中并发送
Save table in doc and send it