Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling address from web browser control 1

Status
Not open for further replies.
Jul 17, 2002
8
US
Does anyone know if it is possible to call the address from the web browser control? If it is, would you share some sample code?
 
You could place the following code in the form's On Load event:

Me!WebBrowser1.Navigate "
You could place a Text Box Control called URLAddress on the form, then add a Command Button with an On Click event that uses the following code:

Me!WebBrowser1.Navigate Me!URLAddress

Have fun! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
I think I phrased my question poorly - I already have the code so that a user can type in a web address and send the browser to that address. My problem is capturing an address from an automatic redirect. For example, a user types in an outdated web address, the browser goes to a redirect page and then automatically takes the user to the correct page - however, the user can't see what the new address it. I was wondering if there is a way to derive the new address from the browser control's properties?
 
On the browser control's PropertyChange and Updated events, place the following code;

Private Sub WebBrowser1_PropertyChange(ByVal szProperty As String)

Me!URLAddress = Me!WebBrowser1.LocationURL

End Sub

Private Sub WebBrowser1_Updated(Code As Integer)

Me!URLAddress = Me!WebBrowser1.LocationURL

End Sub

This will display the current URL in the browser control.

[shadeshappy] Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Brilliant - thank you so much. That was just what I needed. For some reason .LocationURL doesn't show in my list of properties.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top