Adding Help for Your Custom Solution

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.

Associating Help with a Master

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.

To associate Help with a master on a stencil

  1. Open the stencil as Original or click the icon on the stencil title bar, and then click Edit on the shortcut menu so you can edit its masters.
  2. Double-click a master to open its drawing window, and then select the shape.
  3. On the Format menu, click Special.
  4. In the Help box, use the following syntax to enter the Help file name and keyword:
  5.  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 
  6. Click OK.

When a user clicks the Help command, the indicated topic appears as follows, depending on the Help system you're creating:

  • In a standard window that is part of the master Help system for HTML Help.
  • In a pop-up window that is not linked to a parent Help system for WinHelp.

If you do not define a Help topic for a shape, the Help command is dimmed on the menu.

Note


Pressing F1 displays the Microsoft Visio Help, not a particular shape's topic.

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).

Testing Shape Help

Make sure your shape Help is as thoughtfully designed as the shape itself. Test the Help and its jumps for consistency and accuracy.

To test shape Help

  1. Right-click a master on the stencil, or create an instance of the shape and right-click the instance on the page. Click Help on the shortcut menu and check that the correct Help topic appears.
  2. Create another instance of the shape, point to the instance, and click the right mouse button. Click Help on the shortcut menu and check that the correct Help topic appears.
  3. Test all jumps to make sure they display the correct topics.
  4. Check each topic for spelling, grammar, consistency, and accuracy of its content.

Adding HTML Help that is Integrated with the Microsoft Visio Help System

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.



Developing Microsoft Visio Solutions 2001
Developing Microsoft Visio Solutions (Pro-Documentation)
ISBN: 0735613532
EAN: 2147483647
Year: 2004
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net