In VB6 classical, we could do:
Private Sub Form_Load()
WebBrowser1.Navigate2 "http://yourSite.com"
End Sub
Private Sub Command1_Click()
With Webbrowser1
.Document.All("fieldName").Value = "some value"
'click the button
.Document.All("fieldName").Click
End With
End Sub
However in VB.Net, we get error that there is no Value property, so I tried:
With wb
' fill From field
.Document.All("fieldName").SetAttribute("Value", strFrom)
' click the button now
.Document.All("fieldName").RaiseEvent("Click")
End With
But even that generates an error:
Object reference not set to an instance of an object.
On line:
.Document.All("fieldName").SetAttribute("Value", strFrom)
How to do same thing in VB.net ?
I remember the old VB6 way, if you want to invoke a HTML Element’s click event in VB.Net code:
With setting attributes, try this as an example (off the top of my head):