KentBurel
Board Regular
- Joined
- Mar 27, 2020
- Messages
- 68
- Office Version
- 2019
- Platform
- Windows
I'm working to link my workbook to a .CHM file for my help system. I used the Microsoft HTML Help Workshop and the CHMProcessor tools I found on the web. They are not the best but I've made them work. I wrote my help file in Word and then compiled them to a .chm file. Then I put the .chm file in the same directory as my .xlsx file. Next I added code to the ThisWorkbook module that looks like this:
Then I wrote a macro for the GetHelp associated with F1. It look like this:
This all works. Now wherever I am, I can hit Fn-F1 on my keyboard and I see my help file.
The Application.Help method also supports the HelpContextID property. I want to set F1 with the Sheet.Activate event to pass a HelpContextID when someone hits F1 so that I can guide them directly to the help topic for that sheet. How do I get the HelpContextID for a given topice in my .chm file so I can pass the right ID from Excel?
VBA Code:
Sub Workbook_open()
Application.OnKey "{F1}", "GetHelp"
End Sub
Then I wrote a macro for the GetHelp associated with F1. It look like this:
VBA Code:
Option Explicit
Sub getHelp()
Dim currentPath As String
currentPath = ActiveWorkbook.Path
Application.Help (currentPath & "\LogicAndAccuracyTesting.chm")
End Sub
The Application.Help method also supports the HelpContextID property. I want to set F1 with the Sheet.Activate event to pass a HelpContextID when someone hits F1 so that I can guide them directly to the help topic for that sheet. How do I get the HelpContextID for a given topice in my .chm file so I can pass the right ID from Excel?