Hi,
I am trying to find text in a document using TextRange Object.
After I do:
docrng = document.body.createTextRange(), I want to find, all the paragraphs selected by the user. I have created another range for holding selected text. This is called
rng = document.selection.createRange();
I hold the selected string:
mystr = rng.text;
The paragraphs in mystr are stored in any array called
subStrings[] by finding new lines and splitting the text.
If I select any one para on a document, then docrng.findText(subSrrings[0]) will return true. But if I select 2 para’s, then i have: subStrings[0] and subStrings[1].
If I pass docrng.findText(subSrrings[0]) , then it is returning false! But for docrng.findText(subSrrings[1]) it returns true.
Therefore whenever I select more than one para docrng somehow knows that there is a new line and hence it is just returning true for last paragraph only.
Can someone tell me how to solve this?
I want findText() to return true for multiple paragraph selection.
thanks in advance.