Please help with the VBA code for opening the default
browser and pointing to a specific Web site, from within
Microsoft Word.

This is an entry I would like to place on a Microsoft Word
menu.

Any help will be appreciated.
--
jmorley

Re: Web Link in Menu by Larry

Larry
Sat Oct 11 01:26:35 CDT 2003


Here is code that will open Internet Explorer, then open the named
website:

Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE
www.washingtonpost.com"), vbNormalFocus

Alter this code according to the path of the default browser in your
system and the desired web address. There are also several options for
the way IE opens, which you can access by typing a comma after the close
parentheses following the web address. Then just use the Customize
dialog box to drag the macro the menu you want.

Larry




jmorley wrote:
> Please help with the VBA code for opening the default
> browser and pointing to a specific Web site, from within
> Microsoft Word.
>
> This is an entry I would like to place on a Microsoft Word
> menu.
>
> Any help will be appreciated.
> --
> jmorley



Re: Web Link in Menu by Lars-Eric

Lars-Eric
Sat Oct 11 07:13:46 CDT 2003

jmorley,

The following code will open a web page in the default browser.

'--------------------------------
Private Declare Function ShellExec Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal pOperation As String, _
ByVal pFile As String, _
ByVal pParam As String, _
ByVal pDir As String, _
ByVal nShow As Long) As Long

Sub OpenWeb()
Dim nResult As Long

nResult = ShellExec(0, "Open", "HTTP://www.microsoft.com", "", "", 0)

If nResult <= 32 Then
MsgBox "Sorry, could not start you Browser"
End If
End Sub
'----------------------------------

Regards,
Lars-Eric

"jmorley" <scriptwerx@earthlink.net> skrev i meddelandet
news:031101c38f67$92c14910$a301280a@phx.gbl...
> Please help with the VBA code for opening the default
> browser and pointing to a specific Web site, from within
> Microsoft Word.
>
> This is an entry I would like to place on a Microsoft Word
> menu.
>
> Any help will be appreciated.
> --
> jmorley