PDA

View Full Version : Solved: Launch IE from outlook



Chris_cs
06-13-2007, 03:54 AM
I'm trying to write a small sub to launch IE and pass it a URl to use but I can't get it to work. I'm using the following line to launch IE but I'm not sure ow to pass the URL.

Shell "C:\Program Files\Internet Explorer\iexplore.exe"

Can anyone shed any light on this?

Chris_cs
06-13-2007, 08:27 AM
Not to worry. I managed to figure this out.

Ebrow
06-13-2007, 11:40 AM
In case anyone else is looking for a solution:


Function controlIE(myURL As String)

Dim myIE As Object

Set myIE = CreateObject("internetexplorer.application")

myIE.navigate (myURL)
myIE.Visible = True


End Function



Use it like this


Sub Test()
Call controlIE("www.vbaexpress.com") 'by string

call ControlIE(myURL) 'by variable
End Sub