在VB中,如何用一个菜单项调用一个帮助文件或打开一个网页。

解决方案 »

  1.   

    打开网页:
    Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE www.google.com", vbMaximizedFocus
      

  2.   

    Option Explicit
    '声明API函数用于异步打开一个文档
    Private 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
    Private Const SW_SHOWNORMAL = 1   然后在过程中调用:private Sub CmdHelp_Click()
    dim a as long
    Dim b As String
    b = App.Path & "\help.chm" '用变量b记录与主程序同目录下的help.chm帮助文件
    a = ShellExecute (0, "open", b, "", "", SW_SHOWNORMAL)
    End Sub