Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB6: RunAnonymousFunctionSync to retrieve the height of page
#1
Hi. I try to retrieve the height of the scroll bar of a page that is fully loaded to AntView

I use bellow vb6 code

Code:
Set myDocumentHTML = New AntViewDocument
myDocumentHTML.BrowserDispatch wbEdge.IDispatchPointer

Dim strRes As String
Dim intRes As Integer

intRes = myDocumentHTML.RunAnonymousFunctionSync(1, "", "window.innerHeight;", strRes) 

Debug.Print "Result: " & intRes '22 functon timeout
Debug.Print "Data result: " & strRes 'String is empty

Unfortunately, I do not manage to get a result. All the time, the function returns the value 22 which means timeout

Can you point out how to retrieve the height of the loaded page?

To scroll the page I use this function

Code:
 wbEdge.ExecuteScript "window.scrollTo(0,0);"

and it works very well but I can't get the height of the page

Best regards Przemek
Reply


Messages In This Thread
VB6: RunAnonymousFunctionSync to retrieve the height of page - by MrPrzemek - 2023-10-01, 10:55:46

Forum Jump:


Users browsing this thread: 1 Guest(s)