【问题标题】:Create automatically Google docs with App Script( need example )使用 App Script 自动创建 Google 文档(需要示例)
【发布时间】:2013-12-27 15:27:23
【问题描述】:

我需要有关带有 App Script 的 Google Doc 的示例或信息。 我需要使用我的 App Script 自动创建一个 Google 文档。

在哪里可以找到更多关于我构建 Google 文档的示例?

问候

【问题讨论】:

    标签: google-apps-script google-drive-api google-docs google-docs-api


    【解决方案1】:

    使用this 指南

    实际上要创建一个文档,您只需要这样做:

    function createDoc() {
      var doc = DocumentApp.create('Sample Document');
      var body = doc.getBody();
      var rowsData = [['Plants', 'Animals'], ['Ficus', 'Goat'], ['Basil', 'Cat'], ['Moss', 'Frog']];
      body.insertParagraph(0, doc.getName())
      .setHeading(DocumentApp.ParagraphHeading.HEADING1);
      table = body.appendTable(rowsData);
      table.getRow(0).editAsText().setBold(true);
      }
    

    【讨论】:

    • 谢谢,但我需要示例,例如在本文档中使用设计。有可能吗?
    • 已编辑答案,请检查是否正常。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    • 2017-01-28
    • 1970-01-01
    • 2015-08-09
    相关资源
    最近更新 更多