Share via


Displaying Help for Properties and Methods in Class Modules

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

You can add Help information for the custom properties and methods in your class modules. If you do so, Help can be displayed for these properties and methods by pressing F1 when they are viewed in the Object Browser or used in a procedure. This feature is useful if you will be distributing your applications to other developers.

To provide Help for properties and methods in a class module

  1. Create a Help file that contains the topics you want to display and maps each topic to a numeric context ID.

  2. Open the Visual Basic Editor in the application you are working with.

  3. In the Project Explorer, right-click the name of the VBA project for the document you are working with, and then click projectname Properties.

  4. In the Help File Name box, specify the name of the Help file that contains the Help topics. If you don't include the full path, Help will be displayed as long as the Help file is installed in the same folder as your application.

    **Note   **You can specify only one Help file per VBA project. If you want to define context-sensitive Help for more than one class module or for UserForms in the project, the Help file you specify must contain topics for all of these items.

  5. Open the Object Browser, and then click the name of your class module in the Classes box.

  6. In the Members Of box, right-click a property or method, and then click Properties.

  7. In the MemberOptions dialog box, type the context ID of the topic to display in the Help Context ID box. You can also type a description that will display in the Object Browser in the Description box.

  8. Repeat steps 6 and 7 for each property and method in your class module.

See Also

Displaying Help from VBA Code | Displaying Help by Using the Help Method | Displaying Help by Using the HtmlHelp API | Displaying Help by Using the InputBox and MsgBox Functions | Displaying Help for Custom Error Messages | Creating a Help File to Use with an Office Application