Hi I have written a piece of code which allows the program to take a postcode from a text box then type it into Bing for the user. This works perfectly fine when I use www.bing.com but if I was to use http://www.bing.com/maps/?mkt=en-gb so that the postcode is type directly into Bing maps then it crashes. I have included a copy of my code which works with the standard Bing search but would like some advice on allowing the program to search directly into Bing maps without the program crashing.
Thank you
Public Class Form1
Dim Automate As Boolean
Private Sub BTNMAPP_Click(sender As Object, e As EventArgs) Handles BTNMAPP.Click
Automate = True
BingBrowserWindow.Navigate("https://www.bing.com")
End Sub
Private Sub BingBrowserWindow_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles BingBrowserWindow.DocumentCompleted
If Automate = True Then Automate = False Else Exit Sub
Dim txt As HtmlElement = BingBrowserWindow.Document.GetElementById("q")
Dim btn As HtmlElement = BingBrowserWindow.Document.GetElementById("go")
txt.SetAttribute("value", PostcodeTextBox.Text)
btn.InvokeMember("click")
End Sub