HelpFile Property (Visual Basic)

Applies To

Err Object.

Description

Returns or sets a fully qualified path to a Microsoft Windows Help file.

Syntax

object.HelpFile [= pathspec]

The HelpFile property syntax has these parts:

Part

Description

object

Always the Err object.

pathspec

Fully qualified path to the Help file.


Remarks

If a Microsoft Windows Help file is specified in HelpFile, it is automatically called when the user presses the Help button (or the F1 key) in the error message dialog box. If the HelpContext property contains a valid context ID for the specified file, that topic is automatically displayed. If no HelpFile is specified, then the Visual Basic Help file is displayed.

Note You should write routines in your application to handle typical errors. When programming with an object, you can use the Help supplied by the object’s Help file to improve the quality of your error handling, or to display a meaningful message to your user if the error is not recoverable. When writing OLE Automation objects, you should tailor your Help to programmers programming with your object, as well as supply meaningful information to an end user for an unrecoverable error. Not all Visual Basic host applications can create OLE Automation objects. See your host application’s documentation to determine whether it can create classes and OLE Automation objects.

See Also

Description Property, Err Object, HelpContext Property (Visual Basic), LastDLLError Property, Number Property, Source Property.

Example

This example uses the HelpFile property of the Err object to start the Microsoft Windows Help system. By default the HelpFile property contains the name of the Visual Basic Help file.


Err.ClearError Resume Next        ' Suppress errors for demonstration purposes..Raise 6                ' Generate "Overflow" error.= "Press F1 or Help to see " & Err.HelpFile & _
    " topic for this error"Msg, , "Error: " & Err.Description,Err.HelpFile, Err.HelpContext