Office中国论坛/Access中国论坛

标题: ACCESS中调用CHM格式的帮助文件的问题? [打印本页]

作者: hbhscwm    时间: 2007-8-31 16:42
标题: ACCESS中调用CHM格式的帮助文件的问题?
菜鸟提问:在ACCESS中调用CHM格式的帮助文件,zhuyiwun的如下代码如何使用啊?请指教。

Sub AddHelpMenu()
    Dim cbrBar          As CommandBar
    Dim ctlCBarControl  As CommandBarControl
   
    ' Set a reference to the Help menu.
    Set cbrBar = CommandBars!Help
   
    ' If the My Help command already exists, delete it.
    For Each ctlCBarControl In cbrBar.Controls
        If ctlCBarControl.Caption = "&My Help" Then
            cbrBar.Controls("My Help").Delete
        End If
    Next
   
    ' Create a new CommandBarControl object on the Help menu
    ' and add a reference to it.
    Set ctlCBarControl = cbrBar.Controls.Add(Type:=msoControlButton)
   
    ' Set properties of the new command to display context-sensitive
    ' pop-up help. Set OnAction to call DisplayHelp procedure to display
    ' a help topic when clicked.
    With ctlCBarControl
        .Caption = "&My Help"
        .BeginGroup = True
        .FaceId = 0
        .
        .HelpFile = "sample.chm"
        .HelpContextID = 1000
        .Visible = True
    End With
End Sub

Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
    (ByVal hwndCaller As Long, _
    ByVal pszFile As String, _
    ByVal uCommand As HH_COMMAND, _
    dwData As Any) As Long
作者: sgrshh29    时间: 2007-8-31 16:56
这样用也可以了.[attach]26074[/attach]
作者: hbhscwm    时间: 2007-8-31 18:08
在上面的示例中按F1调不出帮助文件啊




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3