Getting Cursor Position From WebEdit - Codoid
Select Page
Codoid Blog

Getting Cursor Position From WebEdit

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

If you want to retrieve cursor position from an WebEdit, it can be done using Range boundary from Selection.

Code

Dim oPage:Set oPage=Browser("name:=Google").Page("title:=Google")
Dim oSel:Set oSel=oPage.Object.Selection.createRange
Dim oWebEdit:Set 

oWebEdit=oPage.WebEdit("name:=q").Object

oSel.moveStart "character",-Len(oWebEdit.value)

Msgbox  Len(oSel.text)
'Here you will get the cursor position.

Set oPage=Nothing
Set oSel=Nothing
Set oWebEdit=Nothing
  

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


If you want to retrieve cursor position from an WebEdit, it can be done using Range boundary from Selection.

Code

Dim oPage:Set oPage=Browser("name:=Google").Page("title:=Google")
Dim oSel:Set oSel=oPage.Object.Selection.createRange
Dim oWebEdit:Set 

oWebEdit=oPage.WebEdit("name:=q").Object

oSel.moveStart "character",-Len(oWebEdit.value)

Msgbox  Len(oSel.text)
'Here you will get the cursor position.

Set oPage=Nothing
Set oSel=Nothing
Set oWebEdit=Nothing