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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open Internet Explorer via automation

COM and Automation

How to open Internet Explorer via automation

by  Mike Gagnon  Posted    (Edited  )
Two methods to surf the internet within VFP (the second method is more restrictive)

Code:
#1 
LOCAL loHyperlink
loHyperlink = CREATEOBJECT("hyperlink")
loHyperlink.navigateto("www.yourdomain.com")
______________________________________________________
#2
Code:
Public   lcUrl
lcUrl = "www.yourdomain.com"
oform = Createobject("Explorer")
oform.AddObject("iExp","iExp")
oform.iExp.Height = oform.Height-1
oform.iExp.Width = oform.Width-1
oform.iExp.Navigate(lcUrl)
oform.Show()
Define Class Explorer As Form
    Autocenter = .t.
	Height = 600
	Width = 800
	Caption = "Navigate the Internet"
Enddefine
Define Class iExp As OleControl
	OleClass = "Shell.Explorer"
	Procedure Refresh
	Nodefault
Endproc
Visible = .T.
Enddefine
Mike Gagnon
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top