A read/write property that either sets or returns a long integer value containing the context ID of the appropriate topic within a Help file.
The HelpContext property can be set either directly or by
supplying the fifth parameter (the
helpcontext parameter) to the
HelpContext IDs are decided upon when writing and creating a Windows help file. Once the Help or HTML help file has been compiled, the IDs can’t be changed. Each ID points to a separate Help topic.
On Error Resume Next Dim i i = 8 MsgBox (i / 0) If Err.Number <> 0 Then Err.Description = "You are attempting to divide by zero." Err.Helpfile = "C:\Windows\help\CustomApp.CHM" Err.HelpContext = 1000000 + Err.Number MsgBox Err.Description, vbMsgBoxHelpButton, "Error", Err.HelpFile, _ Err.HelpContext End If
You can display a topic from a help file by supplying
values to the Err.HelpFile and Err.HelpContext properties, using
the MsgBox function with the
vbMsgBoxHelpButton constant and
Err.HelpContext as the
HelpContext argument (as shown in the
If you supply a HelpContext ID that can’t be found in a Windows Help file, the contents page for the Help file should be displayed. However, what actually happens is that a Windows Help error is generated, and a message box is displayed that informs the user to contact their vendor. If you supply a HelpContextID that cannot be found in an HTML ...