Replace text in multiple Google Docs of a specific folder

99封情书 提交于 2021-01-07 06:57:05

问题


I've tried variations of code to get this to work, but nothing is working. Can anyone help?

    function pleaseWork() {
  var files = DriveApp.getFolderById("IDofFolder").getFilesByType(MimeType.GOOGLE_DOCS);
  while (files.hasNext()) {
    var file = files.next();
    Logger.log(file.getName());
    var doc = DocumentApp.openById(file.getId());
    doc.replaceText("User Services", "Customer Success");
  }
  Logger.log("Done")
}

来源:https://stackoverflow.com/questions/65334592/replace-text-in-multiple-google-docs-of-a-specific-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!