Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Scraping

Status
Not open for further replies.

Thenolos

Technical User
Jul 15, 2004
38
Hello,

I am picking apart a database that was created by someone who used to work in our department... The purpose of the code is to screen scrape the information from another window.

This is a my modified version of his code... I get the concept, and the code works great, however I cannot find any documentation on the .area function... copy function is basically:

scr.area(y1,x1,y2,x2)

Can anyone point be to a website or somewhere in the help file that would explain where this function comes from?


Here's the code if you need to see it in context to get what I'm saying.


Private Sub cmdGet_Click()
On Error Resume Next

Dim pn, pf, pl, ns, acn, soc As String
Dim sp, cp, i As Integer
Dim ex, sess, scr As Object


Set ex = CreateObject("Extra.system")
Set sess = ex.activesession.path

For i = 1 To ex.sessions.Count 'for all the open sessions
Set sess = ex.sessions.Item(i) 'start at 1
Set scr = sess.Screen 'sets scr = to current sessions screen



If scr.area(1, 2, 1, 8) = "R00010" Then 'checks to see if on cert screen

pn = RTrim(scr.area(5, 11, 5, 50))
cp = InStr(1, pn, ",")
pl = Mid(pn, 1, cp - 1)
ns = Mid(pn, cp + 1, (Len(pn) - cp))
ns = Trim(ns)
sp = InStr(1, ns, " ")

If sp = 0 Then
pf = ns
Else
pf = Mid(ns, 1, sp - 1)
End If

Me![PrimaryLast] = pl
Me![PrimaryFirst] = pf
Me![AccountNumber] = Trim(scr.area(3, 11, 3, 30))
Me![Social] = scr.area(4, 11, 4, 19)

Set ex = Nothing
Set sess = Nothing
Set scr = Nothing

Exit Sub

Else

End If
Next
Msgbox "You must be on the correct screen to get account data!", vbCritical, "Error"

End Sub


Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top