I am compiling a demo from EmbeddedWB which is for IEHelper, in the
DocumentComplete event, I wrote a piece of code found in google to
highlight the text
const
prefix = '<span style="background-color: yellow;">';
suffix = '</span>';
var
tr: IHTMLTxtRange;
begin
tr := ((MyWB.Document AS IHTMLDocument2).body AS
IHTMLBodyElement).createTextRange;
while tr.findText('Given Text', 1, 0) do
begin
tr.pasteHTML(prefix + tr.htmlText + suffix);
end;
end;
end;
However, I found the program even don't go into the while loop, i.e.
findText actually didn't find my text (I am sure the text is there).