I would like to find all the instances of a word in a Google doc and highlight them (or comment - anything so it stands out). I have created the following function, but it o
var search = searchtext;
var index = -1;
while(true)
{
index = text.indexOf(search,index+1);
if(index == -1)
break;
else
/** do the required operation **/
}