Name
Err.HelpFile Property
Class
Microsoft.VisualBasic.ErrObject
Syntax
Err.HelpFile
Description
A read/write String property that contains the fully qualified path of a Windows Help file.
Rules at a Glance
The HelpFile property is automatically set by the Err object when an error is raised.
Example
Programming Tips and Gotchas
You can display a topic from the Visual Basic Help file by using the MsgBox function with the
vbMsgBoxHelpButtonconstant and passingErr.HelpFileas theHelpFileargument (as shown in the example for the Err.HelpContext Property). While this is a simple and very effective way to add more functionality to your applications, bear in mind that some of your users could find the explanations within the VB Help file somewhat confusing. If time and budget allow, the best method is to create your own help file (for which you will need the Help compiler and other Help file resources from the full version of VB) and to pass both the HelpContext and HelpFileName to MsgBox.Some objects that you may use within your application have their own help files, which you can access using HelpFile to display highly focused help to your users.
Remember that once the program encounters an
Exit...statement or anOnErrorstatement, all the properties of theErrobject are reset; this includes the Help file. You must therefore set the Err.HelpFile property each time that your application needs to access the help file.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access