Using Sendkeys to call the Address Bar in Internet Explorer - Help

E

efandango

I am trying to open Internet Explorer and make the cursor go to the Address
Bar (ALT-D). But cannot seem to get the ALT-D to kick in, can someone tell me
where I'm going wrong with this. Internet Explorer fires up, but the cursor
doesn't jump to the Address Bar

Yes, I know SendKeys is not always reliable but don't know any other way to
make this happen.

My Code:

Private Sub Lat2_Click()
On Error GoTo Err_Lat2_Click

Dim stAppName As String

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.co.uk"

Call Shell(stAppName, 1)


Exit_Lat2_Click:
Exit Sub

Err_Lat2_Click:
MsgBox Err.Description

Resume Exit_Lat2_Click

Pause 5

SendKeys "%D", True
 
E

efandango

Sorry Tom, I have notice that my code has the rest of the line missing; it
should have read:

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.co.uk/maps?f=q&hl=en&q=" & Me.[Road_Street] & ", " &
[Postcode]

I am passing some field contents to Googlemaps.

Since then, I have managed to get it to go to the address bar, and enter a
small Javascript line, but now I can't get it to press 'ENTER' so that the
Java line is executed.

any thoughts?
 
D

Douglas J. Steele

So use Tom's suggestion as

Application.Followhyperlink _
"http://maps.google.co.uk/maps?f=q&hl=en&q=" & _
Me.[Road_Street] & ", " & [Postcode]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


efandango said:
Sorry Tom, I have notice that my code has the rest of the line missing; it
should have read:

stAppName = "C:\Program Files\Internet Explorer\iexplore.exe
http://maps.google.co.uk/maps?f=q&hl=en&q=" & Me.[Road_Street] & ", " &
[Postcode]

I am passing some field contents to Googlemaps.

Since then, I have managed to get it to go to the address bar, and enter a
small Javascript line, but now I can't get it to press 'ENTER' so that the
Java line is executed.

any thoughts?


Tom van Stiphout said:
On Sat, 17 Nov 2007 12:49:00 -0800, efandango

Why not use:
Application.FollowHyperlink "http://maps.google.co.uk"

-Tom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top