google scripts docs highlight

The solution for “google scripts docs highlight” can be found here. The following code will assist you in solving the problem.

//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));

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in