IHTMLDocument2 doc = (IHTMLDocument2)wbDocument.Document.DomDocument; IHTMLSelectionObject sel = (IHTMLSelectionObject)doc.selection; IHTMLTxtRange rng = (IHTMLTxtRange)sel.createRange(); if (rng != null) { rng.expand("word"); if (rng.text != null) { rng.@select(); if (rng.text.Trim() != "") { selectedWordorSentance = rng.text; if (timer1.Enabled) { timer1.Stop(); } timer1.Interval = 500; timer1.Start(); } } }
IHTMLDocument2 doc = (IHTMLDocument2)wbDocument.Document.DomDocument; IHTMLSelectionObject sel = (IHTMLSelectionObject)doc.selection; IHTMLTxtRange rng = (IHTMLTxtRange)sel.createRange(); if (rng != null) { rng.expand("sentence"); if (rng.text != null) { rng.@select(); if (timer1.Enabled) { timer1.Stop(); } selectedWordorSentance = rng.text; ShowSelectedWordOrSentance(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)