T
Ted
Good Morning!
I found some code that opens IE, navigates to a web page and enters data
into fields then clicks to enter the data.
The problem is you need the field name for the code to work.
Does anyone know the name of the field you enter the address into so that I
can program that into my VBA (I'm using Access)?
Here is the code I've modified from code Leith Ross submitted in another
posting.
I could easily do this in mapquest, but maps.live is my site of choice for
obvious reasons
'Copy address to maps.live.com to view address on map
Dim IEapp As Object
Dim strPassword As String
Dim strUserName As String
Dim strURL As String
Dim strAddress As String
strURL = "http://maps.live.com/"
strAddress = Me.Address1 & ", " & Me.Zip
Set IEapp = CreateObject("InternetExplorer.Application")
With IEapp
.Visible = True
.Navigate strURL
End With
'Wait until Internet Explorer finishes loading
While IEapp.Busy
DoEvents
Wend
'Inserts the Address
IEapp.Document.all("Location-I need this field name").Value = strAddress
'Wait till the page is loaded
While IEapp.Busy
DoEvents
Wend
'Click or enter
IEapp.Document.all.Click
While IEapp.Busy
DoEvents
Wend
I found some code that opens IE, navigates to a web page and enters data
into fields then clicks to enter the data.
The problem is you need the field name for the code to work.
Does anyone know the name of the field you enter the address into so that I
can program that into my VBA (I'm using Access)?
Here is the code I've modified from code Leith Ross submitted in another
posting.
I could easily do this in mapquest, but maps.live is my site of choice for
obvious reasons

'Copy address to maps.live.com to view address on map
Dim IEapp As Object
Dim strPassword As String
Dim strUserName As String
Dim strURL As String
Dim strAddress As String
strURL = "http://maps.live.com/"
strAddress = Me.Address1 & ", " & Me.Zip
Set IEapp = CreateObject("InternetExplorer.Application")
With IEapp
.Visible = True
.Navigate strURL
End With
'Wait until Internet Explorer finishes loading
While IEapp.Busy
DoEvents
Wend
'Inserts the Address
IEapp.Document.all("Location-I need this field name").Value = strAddress
'Wait till the page is loaded
While IEapp.Busy
DoEvents
Wend
'Click or enter
IEapp.Document.all.Click
While IEapp.Busy
DoEvents
Wend