Hi,
I am facing one issue with HTML programming with VB 6.0. I have created one automate program to fill a web form on the internet with Visual Basic 6.0.
For example observer below code.
Step 1: Create one Standard EXE project.
Step 2: Add reference to "Microsoft HTML Object Library" - You can add this from \windows\system32\mshtml.tlb
Step 3: Add reference to "Microsoft Internet Controls" - You can add this from \windows\system32\ieframe.dll.
Copy and Paste Below code in form1.
Private Sub Form_Load()
Dim IE As SHDocVw.InternetExplorer
Set IE = Nothing
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "www.google.com"
Do While IE.Busy
DoEvents
DoEvents
Loop
IE.Visible = True
Dim HtmEle As HTMLHtmlElement
DoEvents
DoEvents
IE.Document.getElementById("q").Value = "text"
DoEvents
DoEvents
Set HtmEle = IE.Document.getElementById("btng")
If Not HtmEle Is Nothing Then
MsgBox "HtmEle Object set." & vbCrLf & "Now it will click on Google Search button."
HtmEle.Click
End If
End
End Sub
Now instead of doing this click on Google Search button I want to do Right Click on that button. I tried to do it with mouse_event API it would solve my issue. But it gets failed when I resize the IE or move IE. I think I will require X,Y co-ordinate of that htmele.
Is there any way from that I can do right click on that htmele?
If I can get X,Y co-ordinate of htmEle in screen that would be also very helpful.
Thanks in advance.