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