[英]Google App Script : how to convert PDF to GDOC in order to get OCR?
[英]Google App Script Delete Table Column in a GDoc
我正在编写一个脚本来自动创建报告,该脚本创建一个谷歌文档并用来自不同来源的信息填充它,该报告有一个使用以下代码从谷歌电子表格复制的表格:
// get the Spreadsheet by sheet id
var source = SpreadsheetApp.openById(OPERATIONS_FILE);
// select the sheet
var sourcesheet = source.getSheetByName(OPERATION_SHEET);
// get the values on selectd range
var srcData = sourcesheet.getRange(OPERATION_RANGE).getValues();
// Set the variable templates on the new Report
var newReport = DocumentApp.openById( reportFile.getId() );
var reportBody = newReport.getBody();
reportBody.replaceText('{date}', dateForTitle);
reportBody.replaceText('{workWeek}', weekNumber[1]);
// Get the data from the Dashboard and put it on the Report
var range = reportBody.findText("{operation}");
var operationsTable = "";
var ele = range.getElement();
if (ele.getParent().getParent().getType() === DocumentApp.ElementType.BODY_SECTION) {
var offset = reportBody.getChildIndex(ele.getParent());
operationsTable = reportBody.insertTable(offset + 1, srcData);
}
现在插入到谷歌文档“操作表”中的表格包含我需要删除的额外列(电子表格中需要这些列用于计算目的)我在谷歌脚本文档上找到了 RemoveRow(I) function 但找不到 RemoveColumn(I)一旦在谷歌文档上,你如何删除表格的某些列?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.