HelpContext Property
Sets or returns the context ID of the Help file topic.
object.HelpContext [= contextID]
Parameters
Object
Required option. The Err object.
ContextID
Options available. Valid identifier of the Help topic in the Help file.
Description
If you specify a Help file in HelpFile , the helpcontext property is used to automatically display the Help topic for the identity. If both HelpFile and helpcontext are empty, check the number property. If it corresponds to a VBScript run-time error value, the VBScript Help context ID for the error is used. If the number property does not correspond to a VBScript error, the directory of the VBScript Help file is displayed.
The following example illustrates how to use the helpcontext property:
An "Overflow" error occurred in On Error Resume Nextdim MsgErr.ClearErr.Raise 6 '
. err.helpfile = " Yourhelp.hlp
err.helpcontext = Yourcontextid
If err.number <> 0 Then
Msg =
Press F1
key or help
view & Err.HelpFile &
with the following code> HelpContext "& _ "
Related Topics : "& err.helpcontext
MsgBox Msg," error : "& Err.Description, Err.HelpFile, Err.helpcontext
end If