ErrObject.HelpFile Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns or sets a String expression containing the fully qualified path to a Help file. Read/write.

Namespace:   Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public string HelpFile { get; set; }

Property Value

Type: System.String

Returns or sets a String expression containing the fully qualified path to a Help file. Read/write.

If a Help file is specified by the HelpFile property, it is automatically called when the user presses the Help key (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, the Visual Basic Help file is displayed.

System_CAPS_noteNote

You should write routines in your application to handle typical errors. When programming with an object, you can use 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.

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

Dim Msg As String
Err.Clear()
On Error Resume Next   ' Suppress errors for demonstration purposes.
Err.Raise(6)   ' Generate "Overflow" error.
If Err.Number <> 0 Then
  Msg = "Press F1 or HELP to see " & Err.HelpFile & " topic for" & 
  " the following HelpContext: " & Err.HelpContext
  MsgBox(Msg, , "Error:")
End If

.NET Framework
Available since 1.1
Return to top
Show: