将谷歌电子表格转换为谷歌脚本中的xls

时间:2012-10-12 07:47:20

标签: google-apps-script

  

可能重复:
  Google apps script to email google spreadsheet excel version

我到处寻找这个,但无法让它发挥作用。我发送的电子邮件附带谷歌应用脚​​本中的附件。该文档是谷歌电子表格。它目前作为pdf发送,但是,我希望它作为xls发送。当我运行以下代码时,我收到“请求不支持的转换”。如何将其作为xls发送?

function practiceMail() {

var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveRange();
var file = DocsList.getFileById(docID);
var attachment = file.getAs('application/vnd.ms-excel');
var myFile = [file];

MailApp.sendEmail(email, subject, body, {attachments:myFile, mimetype:application/vnd.ms-  excel });
}

2 个答案:

答案 0 :(得分:1)

请参阅this question以获取解释。简而言之,答案是否定的。你不能做这个。但是,有一个open issue您可以加注星标来请求此功能。

答案 1 :(得分:0)

相关问题