Private Sub mnuContents_Click() With dlgChart 'CommandDialog .HelpFile = App.Path & "\MSChart.hlp" .HelpCommand = cdlHelpTopics .ShowHelp End With End Sub
值得參考: http://dev.csdn.net/htmls/85/85082.html
确认一下help.chm是否在当前路径下!
1、在模组中定义 Option Explicit 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 Public Const SW_SHOWNORMAL = 12、在Form中执行打开Chm文件 Private Sub cmdShowHelpFile_Click() Dim a As Long Dim b As String b = App.Path & "\crm.chm" a = ShellExecute(0, "open", b, "", "", SW_SHOWNORMAL) End Sub
With dlgChart 'CommandDialog
.HelpFile = App.Path & "\MSChart.hlp"
.HelpCommand = cdlHelpTopics
.ShowHelp
End With
End Sub
http://dev.csdn.net/htmls/85/85082.html
Option Explicit
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
Public Const SW_SHOWNORMAL = 12、在Form中执行打开Chm文件
Private Sub cmdShowHelpFile_Click()
Dim a As Long
Dim b As String
b = App.Path & "\crm.chm"
a = ShellExecute(0, "open", b, "", "", SW_SHOWNORMAL)
End Sub