Defining Double-Click Actions for Shapes

An easy way to make a shape smart is to have it do something when you double-click it. For most Visio 2007 shapes, the built-in double-click behavior is to open the shape’s text block so that you can type. However, Visio 2007 provides several options that you can specify with the Behavior command on the Format menu, as Figure 25-8 shows. For example, you can configure a shape so that the Report dialog box opens when you double-click the shape.

Figure 25-8. On the Double-Click tab, you can define what will happen when the shape is double-clicked.


Note

You can add double-click behavior to objects from another application that you’ve linked or embedded in Visio 2007. The OLE Verb option in the Behavior dialog box is available only when you select a linked or embedded object.


Displaying a Help File for a Shape

One of the double-click behaviors that you can define for a shape is Display Help. This option is really designed for professional shape developers who want to link shapes to custom Windows help files (.hlp or .chm files). If you fall into this category, you must identify the help file and a topic in that file using the following syntax:

filename!keyword or filename!#Number

Filename is the name of the help file, such as MyShape.hlp or MyShape.chm. To locate a specific help topic in the file, you can specify either a keyword that is associated with the topic, or the ID number that is referenced in the MAP section of the help project file.


Follow these steps to set a shape’s double-click behavior:

1.
Select the shape that you want to change.

2.
Choose Format, Behavior, and then click the Double-Click tab. You can also right-click the shape and then choose Format, Behavior.

3.
Choose the action you want to happen when the shape is double-clicked. See Table 25-4 for a list of options and what they do.

Table 25-4. Double-Click Options for Shapes
OptionDescription
Perform Default ActionChoose this option to use the default double-click action defined for the shape.
Perform No ActionChoose this option to remove double-click behavior from the shape.
Edit Shape’s TextChoose this option to open the shape’s text block with the insertion point.
Open Group In New WindowChoose this option to open the group in the group editing window. Double-clicking then has the same effect as choosing Edit, Open Group. This option is available only if you select a group.
Open Shape’s ShapeSheetChoose this option to display the ShapeSheet window for the shape.
CustomThis option indicates a custom formula has been defined in the ShapeSheet window for the shape and always appears dimmed.
Display HelpChoose this option to display a custom help topic for a shape. For details, see the sidebar “Displaying a Help File for a Shape” earlier in this chapter.
OLE VerbChoose this option for a linked or embedded shape to add an OLE command, such as Edit or Open.
Run MacroChoose this option and select a macro or add-in in order to run the macro or add-in when the shape is double-clicked. The list box includes all the available add-ins, many of them built-in Visio 2007 wizards or tools, such as Report and Color Schemes.
Go To PageChoose this option and select a page number to display that page. Select the Open In New Window check box if you want to display the new page in a separate drawing page window.

4.
Click OK.

5.
To test the new behavior, double-click the shape.

Troubleshooting: The Custom option is not available, or the shape’s behavior doesn’t change when you select a double-click action

If the Custom option is selected but appears dimmed, the shape already includes a custom double-click formula, which is defined in the ShapeSheet window. If you select a new option on the Double-Click tab, you can overwrite the custom behavior. However, if a custom formula is protected (such as by the GUARD function), specifying a different behavior on the Double-Click tab will have no effect. Visio 2007 ignores your setting when you click OK. No error message appears; your change is simply not implemented.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset