|
菜鸟提问:在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 |
|