Re: String in text related
If you've figured out how to find the 'Select' position in the text box, then getting the length of the line is quite straight forward :
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(byval hwnd as Long, byval wMsg as Long, byval wParam as Long, _
lParam as Any) as Long
private Const EM_LINELENGTH = &HC1
Say, for instance, that a variable 'lStart' has been set with the start position of the 'Select' text :
Dim lLineLen as Long
Dim sSelectedText as string
'
lLineLen = SendMessage(Text1.hwnd, EM_LINELENGTH, lStart, 0&)
'
sSelectedText = mid$(Text1.Text, lStart, lLineLen - lStart)
- that should be enough to get you on the right track - you'll obviously need to change the 'text1.' to your textbox name.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Re: String in text related
Lothar was once suggesting Using Scripting Runtime (if you have IE 40 or later, SCRRun.dll ? ) for this kind of Parsing/Data validatoin etc.
You can use similar features of that model for doing this kind of 'advanced search'ing too. It will come under 'parsing logic' actually. May be you can contact him!..
RK
Re: String in text related
OK, it does work and it does return me the selected string but why does it return string as number, I need it as value.....What should I fix....
Thank You