Access调用CHM格式的帮助文件(绑定到ACCESS中)
- 2002-06-22 15:58:00
- 田野-Office交流网 原创
- 6144
zhuyiwen
罗斯文中用的 .HLP 帮助文件,开发版代码库中有调用 .CHM 的完整代码。
tmtony
现抄现卖啦
Function ShowHelpAPI() As Boolean ' This procedure is used by the Show Me button on various Developer ' Solutions toolbars. It uses the WinHelp API function so that the ' Show Me Help button will provide context-sensitive Help regardless ' of the current state of the object. Make sure that the Help file is ' in the same directory as the Developer Solutions database. Dim lnghWnd As Long, strHelpFile As String, lngContext As Long Dim lngRetVal As Long, obj As Object On Error Resume Next Const conHelpContext = &H1 Set obj = Screen.ActiveForm If Err = 2475 Then ' Active object is not a form. ' Reset Err and test for Report object. Err = 0 Set obj = Screen.ActiveReport If Err = 2476 Then ' Current object is not a form or a report. MsgBox "Select a form or report before you ask for help." ShowHelpAPI = False Exit Function End If End If With obj ' Get the current object's hWnd, HelpFile, and HelpContextID properties. lnghWnd = .hWnd strHelpFile = .HelpFile lngContext = .HelpContextId End With lngRetVal = WinHelp(lnghWnd, strHelpFile, conHelpContext, lngContext) ShowHelpAPI = True End Function
zhuyiwen
Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal Hwnd As Long, _ ByVal lpHelpFile As String, ByVal wCommand As Long, _ ByVal dwData As Any) Function ShowHelpAPI() As Boolean ' This procedure is used by the Show Me button on various Developer ' Solutions toolbars. It uses the WinHelp API function so that the ' Show Me Help button will provide context-sensitive Help regardless ' of the current state of the object. Make sure that the Help file is ' in the same directory as the Developer Solutions database. Dim lnghWnd As Long, strHelpFile As String, lngContext As Long Dim lngRetVal As Long, obj As Object On Error Resume Next Const conHelpContext = &H1 Set obj = Screen.ActiveForm If Err = 2475 Then ' Active object is not a form. ' Reset Err and test for Report object. Err = 0 Set obj = Screen.ActiveReport If Err = 2476 Then ' Current object is not a form or a report. MsgBox "Select a form or report before you ask for help." ShowHelpAPI = False Exit Function End If End If With obj ' Get the current object's hWnd, HelpFile, and HelpContextID properties. lnghWnd = .hWnd strHelpFile = .HelpFile lngContext = .HelpContextId End With lngRetVal = WinHelp(lnghWnd, strHelpFile, conHelpContext, lngContext) ShowHelpAPI = True End Function
这是开发版代码库中的范例,使用.HLP。
zhuyiwen
TMTONY比我快!
tmtony
没你的提示,我一时还找不到:), 再说, 你的正确些啦,我还没加定义啦
zhuyiwen
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 .OnAction = "DisplayHelpXL" .HelpFile = "sample.chm" .HelpContextID = 1000 .Visible = True End With End Sub
或
Sub DisplayHelpXL() Application.Help Currentproject.Path & "\sample.chm", 2001 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
zhuyiwen
田野,够不够?
你怎么请我吃饭?[em26]
田野
够,够,我 GO,GO,开溜!:)
binbow_z
用SHELL调用HH.exe文件打开.chm文件
田野
binbow_Z,您的方法很好,再问一下,HH.EXE有没有定位的参数,就是说打开chm文件时根据不同情况定位于某一位置。
(开发文档_帮助制作-相关文章技巧链接):
如何制作CHM帮助文件及使用
在VB中调用CHM 帮助的几种方法
Access数据库自身
- office课程播放地址及课程明细
- Excel Word PPT Access VBA等Office技巧学习平台
- 将( .accdb) 文件格式数据库转换为早期版本(.mdb)的文件格式
- 将早期的数据库文件格式(.mdb)转换为 (.accdb) 文件格式
- KB5002984:配置 Jet Red Database Engine 数据库引擎和访问连接引擎以阻止对远程数据库的访问(remote table)
- Access 365 /Access 2019 数据库中哪些函数功能和属性被沙箱模式阻止(如未启动宏时)
- Access Runtime(运行时)最全的下载(2007 2010 2013 2016 2019 Access 365)
Access Activex第三方控件
- Activex控件或Dll 在某些电脑无法正常注册的解决办法(regsvr32注册时卡住)
- office使用部分控件时提示“您没有使用该ActiveX控件许可的问题”的解决方法
- RTF文件(富文本格式)的一些解析
- Access树控件(treeview) 64位Office下出现横向滚动条不会自动定位的解决办法
- Access中国树控件 在win10电脑 节点行间距太小的解决办法
- EXCEL 2019 64位版(Office 2019 64位)早就支持64位Treeview 树控件 ListView列表等64位MSCOMMCTL.OCX控件下载
- VBA或VB6调用WebService(直接Post方式)并解析返回的XML
Access ADP Sql Server等
- 早期PB程序连接Sqlserver出现错误
- MMC 不能打开文件C:/Program Files/Microsoft SQL Server/80/Tools/Binn/SQL Server Enterprise Manager.MSC 可能是由于文件不存在,不是一个MMC控制台,或者用后来的MMC版
- sql server连接不了的解决办法
- localhost与127.0.0.1区别
- Roych的浅谈数据库开发系列(Sql Server)
- sqlserver 自动备份对备份目录没有存取权限的解决办法
- 安装Sql server 2005 express 和SQLServer2005 Express版企业管理器 SQLServer2005_SSMSEE
文章分类
联系我们
联系人: | 王先生 |
---|---|
Email: | 18449932@qq.com |
QQ: | 18449932 |
微博: | officecn01 |