简体   繁体   中英

Is it possible to update table cell borders in Google Slides using Google App Script?

I'm developing a script to programmatically change the color of a table in Google Slides but not seeing a method for updating the table border colors. I see a method for G-Sheets and G-Docs but not G-Slides.

Any help would be appreciated!

It's possible with the [Advanced Slides Service]

( https://developers.google.com/apps-script/advanced/slides )

Sample for implementation in Apps Script:

function myFunction() {
  var id = SlidesApp.getActivePresentation().getId();
  var objectId = SlidesApp.getActivePresentation().getSlides()[0].getTables()[0].getObjectId();
  var resource = {
    "requests": [
      {
        "updateTableBorderProperties": {
          "objectId": objectId,
          "tableBorderProperties": {
            "tableBorderFill": {
              "solidFill": {
                "color": {
                  "rgbColor": {
                    "blue": 0.3,
                    "green": 0.7
                  }
                }
              }
            }
          },
          "fields": "tableBorderFill.solidFill.color"
        }
      }
    ]
  }
  Slides.Presentations.batchUpdate(resource, id);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM