3 4
You can provide online Help that displays general guidelines for using the masters in a stencil or the subtleties of a shape's behavior. Microsoft Visio supports both HTML Help (.chm files) and WinHelp (.hlp files). This section assumes that you are familiar with the techniques and terminology used in creating Microsoft Windows online Help files. For details, see the Microsoft Platform SDK in the MSDN Library.
You can associate Help with any shape in a drawing, but typically you'll associate Help with masters in a stencil. A user displays Help for a shape from the shortcut menu of the shape or master.
Microsoft Visio locates a shape Help topic using the context identifier (ID) number that is specified in the .hpj file that is used to compile .hlp files, or the .hhp file that is used to compile .chm files. To associate a particular Help topic with a shape, you must provide the context ID number for that topic.
filename.hlp!#n or filename.chm!#n
The name of your Help file is filename.hlp or filename.chm and n is the context ID number defined for the topic you want to associate with this shape. For example, Shape.hlp!#63 or Shape.chm!#63.
If you want to display the contents topic of your Help file, do not specify a context ID number. Use the following syntax:
filename.hlp or filename.chm
When a user clicks the Help command, the indicated topic appears as follows, depending on the Help system you're creating:
If you do not define a Help topic for a shape, the Help command is dimmed on the menu.
Note
For Visio to find your Help file, you must place it in the correct folder. By default, Visio first looks for a shape Help file in the default folder for Help files (usually the Help folder under the correct language folder in the Visio product folder). You can change the default folder by changing the Help path setting on the File Paths tab (on the Tools menu, click Options).
Make sure your shape Help is as thoughtfully designed as the shape itself. Test the Help and its jumps for consistency and accuracy.
To create a custom Help system that is integrated with the Microsoft Visio Help system, use the InvokeHelp method. The arguments passed to the InvokeHelp method correspond to those described in the HTML Help API. For a list of command values, see the HTML Help API Reference on the Microsoft DeveloperNetwork (MSDN) Web site. Microsoft Visual Basic programmers can use the numeric equivalent of the C++ constants defined in the HTML Help API header files.
For example, use the following code to show the default Visio Help window:
Application.InvokeHelp "Visio.chm", 15, 0
Use this code to hide the Visio Help window:
Application.InvokeHelp "", 18, 0
For more information on InvokeHelp, see the Microsoft Visio Developer Reference (on the Help menu, click Developer Reference). For more information about the HTML Help API, search for "HTML Help API Overview" on the MSDN Web site.