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调不出帮助文件啊