Bewerken

Delen via


ErrObject.HelpFile Property

Definition

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

public:
 property System::String ^ HelpFile { System::String ^ get(); void set(System::String ^ value); };
public string HelpFile { get; set; }
member this.HelpFile : string with get, set
Public Property HelpFile As String

Property Value

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

Examples

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

Remarks

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.

Note

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.

Applies to

See also