Open a website usine IE from a vba macro

G

Greg Oij

I would like to create a VBA routine that opens Internet Explorer and a specific website from Word
Needs to be compatible with Word '97-Word 2003 and Win '95 or later..

Any suggestions on the cleanest way to accomplish this feat?
 
G

G.O.

-----Original Message-----
I would like to create a VBA routine that opens Internet
Explorer and a specific website from Word.
Needs to be compatible with Word '97-Word 2003 and Win '95 or later...

Any suggestions on the cleanest way to accomplish this feat?
.
For those interested, here is how I ended up accessing
the website from a button:

'In Declarations:
Public Declare Function ShellExecute Lib "shell32.dll"
Alias "ShellExecuteA" _
(ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long

'Function to open Website:
Sub GoogleWebsite()
'This command is on one line:
ShellExecute 0&,
vbNullString, "http://www.google.com", vbNullString,
vbNullString, vbNormalFocus
End Sub
 

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