Export (0) Print
Expand All

ErrObject.HelpFile Property

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.

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

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft