Modifying a drawing using Google Apps Script

前端 未结 3 1499
醉酒成梦
醉酒成梦 2021-01-02 18:43

Has anyone found support for creating or changing a drawing using Google Apps Script? I\'ve looked through the Google documentation, but I don\'t see any classes for drawing

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 19:26

    modifying seldom includes a deletion too...

    var drawingRange = body.findElement(DocumentApp.ElementType.INLINE_DRAWING);
               while (drawingRange != null) {
                   var element = drawingRange.getElement();
                   var drawingElement = element.asInlineDrawing();
                   drawingElement.removeFromParent();
                   drawingRange = body.findElement(DocumentApp.ElementType.INLINE_DRAWING);
               }
    

提交回复
热议问题