我一直想通过ID打开来访问Google演示文稿的内容,但我没有取得成功,所以我想知道是否有人知道该怎么做,请我非常感激,这是我的榜样。
var NombreDeUsuario = "MY_NAME";
//This ID is from a google presentation.
var docid = DocsList.getFileById("1uF7xY9_QjSqFsILcq5IxGaJuzK6GlPLO-O4dWVG80cI").makeCopy().getId();
//here is where it says that it doesn´t found it
var doc = DocumentApp.openById(docid).setName(NombreDeUsuario);
var date = Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd");
var rate = "Excelent";
var body = doc.getActiveSection();
body.replaceText("%DATE%", date);
body.replaceText("%RATE%", rate);
doc.saveAndClose();
答案 0 :(得分:1)
DocumentApp仅用于打开Google文档。我认为没有办法使用GAS编辑演示文稿。 There is an open issue on the topic