This example retrieves the parent object, if needed, creates the text range, moves to the original object, and selects the first word in the object.
<SCRIPT LANGUAGE="JScript">
function selectWord()
{
var oSource = window.event.srcElement ;
if (!oSource.isTextEdit)
oSource = oSource.parentTextEdit;
if (oSource != null) {
var oTextRange = oSource.createTextRange();
oTextRange.moveToElementText(window.event.srcElement);
oTextRange.collapse();
oTextRange.expand("word");
oTextRange.select();
}
}
</SCRIPT>