google-apps-script - 当我调用电子表格名称时,自动电子邮件发票错误
问题描述
我正在尝试自动化我的 Google 表格,以便每个月发送到我的电子邮件。但看起来我在调用电子表格时遇到了问题
var ss = SpreadsheetApp.getActiveSpreadsheet().getName("Invoice test");
var filename = "Current Month " + ss.getName();
var SendBook = ss.copy(filename);
var ToUser = "example@gmail.com";
MailApp.sendEmail({
to: ToUser,
subject: 'Invoice for last month',
body: 'Hi! I have attached my invoice for this month. ',
attachments: [SendBook.getBlob().setName(filename)]
});
}
如果我删除“ .getName("Invoice test");
”,我会在一封电子邮件中收到所有电子表格,我只想要第一页。
解决方案
推荐阅读
- php - Wordpress PHP 警告:非法字符串偏移 'plugin_name'
- scala - 播放 JSON 库和 sbt 程序集合并错误
- javascript - Object.assign 替代 getter/setter
- rest - RESTful API 和统计页面
- powershell - 如何在powershell脚本中添加凭据,这样当我运行脚本时它不会要求输入密码,我不希望在脚本中看到密码
- angular - 如何使用xlsx Angular 8在下载的excel中显示选定的列
- unit-testing - react-navigation-hooks:如何测试 useFocusEffect
- php - 将 header('location: ..\') 设为页面上的当前滚动点
- javascript - 如何在数组 React/Axios 中拆分结果
- javascript - 如何在 Angular 9 中访问组件的唯一封装 ID