📜  google scripts docs highlight - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:26.453000             🧑  作者: Mango

代码示例1
//Will Color the first instance of a string in a document
var document = DocumentApp.openByUrl('myURL');
var hiligherColor = '#F3E2A9';
var stringToColor = 'string';
document.getBody().findText(stringToColor).getElement().asText().setBackgroundColor(document.getBody().findText(stringToColor).getStartOffset(), document.getBody().findText(stringToColor).getEndOffsetInclusive(),(hilighterColor));