google scripts docs highlight

Solutions on MaxInterview for google scripts docs highlight by the best coders in the world

showing results for - "google scripts docs highlight"
Isaac
18 Jan 2017
1//Will Color the first instance of a string in a document
2var document = DocumentApp.openByUrl('myURL');
3var hiligherColor = '#F3E2A9';
4var stringToColor = 'string';
5document.getBody().findText(stringToColor).getElement().asText().setBackgroundColor(document.getBody().findText(stringToColor).getStartOffset(), document.getBody().findText(stringToColor).getEndOffsetInclusive(),(hilighterColor));