Hi Gary,
Firstly I want to let you know that vbscript is a subset of the vb
language. That is, many properties or methods from vb language may not be
implemented in vbscript. In other words, there may be not one-to-one
mapping between vb and vbscript. In addition, there is no mapping table
between the two languages.
As for the selectedText, in HTML, we can make use of the document.selection
object, as well as capturing the MOUSEUP event to implement the same
function as what the selectedText property in desktop application.
For your reference, I copied the whole html below. (I am using JScript for
the demonstrating.)
----------------------------
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var text = "";
function getActiveText(e) {
// Sets text MSIE or Netscape active
// text based on browser, puts text in form
text = (document.all) ? document.selection.createRange().text :
document.getSelection();
document.theform.text.value = text;
return true;
}
document.onmouseup = getActiveText;
if (!document.all) document.captureEvents(Event.MOUSEUP);
// End -->
</script>
</HEAD>
<BODY>
<center>
<form name=theform>
Highlight any text on the page and JavaScript will 'capture'<br>
it in the textbox below. Internet Explorer also allows for <br>
the capture of text highlighted within a textbox or textarea: <br>
Here's two to try out:<br><br>
<input type=text name=demo value="highlight me!"> or <textarea>or highlight
me!</textarea>
<br>
<br>
Selected text: <input type=text name=text value="">
</form>
</center>
</BODY>
</HTML>
---------------------------------------------------
Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.