Microsoft KB Archive/254730
Article ID: 254730
Article Last Modified on 4/11/2007
- Microsoft Office Visio Standard 2007
- Microsoft Office Visio Professional 2007
- Microsoft Office Visio Standard 2003
- Microsoft Office Visio Professional 2003
- Microsoft Visio 2002 Standard Edition
- Microsoft Visio 2002 Professional Edition
- Microsoft Visio 2000 Standard Edition
- Microsoft Visio 2000 Professional Edition
- Microsoft Visio 2000 Technical Edition
- Microsoft Visio 2000 Enterprise Edition
This article was previously published under Q254730
This article explains how to display text that is derived from a shape's custom properties in Microsoft Visio. In this article, the "process" shape from the Basic flowchart stencil is used for illustration purposes. If you use an alternate shape, make sure the shape has custom properties, and that you have entered values into the custom properties.
This article assumes that you have used the ShapeSheet before and are familiar with adding sections and typing formulas.
A simple example
Drag the "process" shape to the drawing page. Right-click the shape to enter values into the three custom properties (cost, duration, and resources). Each property accepts only a numeric value.
- While the shape is still selected, click Field on the Insert menu.
- On the Category menu, click Custom Formula.
- Once chosen, the Custom Formula bar becomes active. Place the mouse pointer in the field and type Prop.Cost.
- Click OK. The shape's text now displays the value of the Prop.Cost row in the Custom Properties section of the ShapeSheet.
Determining the valid row names
For a shape that already has custom properties, it is necessary to determine how to properly reference the custom property rows.
- While the shape is selected, click Show ShapeSheet on the Window menu.
- Scroll to find the Custom Properties section of the ShapeSheet. If it is not visible, click Sections on the View menu. Check custom properties.
- The Custom Properties section will have named rows. The "process" shape has 3: Prop.Cost, Prop.Duration, and Prop.Resources. The "Prop" in the name is added automatically by Visio.
A complex example
The simple example works satisfactorily to display one custom property. The following example explains how to add additional text and custom properties to the display. Again, using the "process" shape with values added into the custom properties, select the text tool, and then follow these steps:
- Type the following:
- Type the word:
Follow steps 1 through 4 again and enter the Custom Formula as Prop.Resources.The resulting shape should look similar to figure 1.
A more complex example: Choosing to display or hide custom properties
The following example shows how to set a right mouse action to display or hide the custom property values on the shape. This example uses the already modified process shape from the previous example.
To see this example, follow these steps:
- Scroll to find the User-defined Cell section of the ShapeSheet. If the User-defined Cell section of the ShapeSheet is not visible, click Sections on the View menu, and then examine User-defined Cell.
- Create a new row and name it HideProperties. The value and the prompt for this section should remain unchanged.
- Add two additional rows to the end of the Actions section of the ShapeSheet.
- Add the following formulas or values to this section.
Action Actions Menu Prompt Checked Disabled 2 =SETF
0 1 3 =SETF
- In the Miscellaneous section of the ShapeSheet, type the following cell reference in the HideText cell:
- Now, when you right-click the shape, there will be two additional options: Show Properties and Hide Properties. By selecting either option, you can decide whether to display text or to hide text.
- If you want to prevent a user from overriding the new formulas by entering text manually into the shape, protect the shape's text against editing by typing 1 in the LockTextEdit cell in the Protection section of the ShapeSheet.
Additional query words: VSO2007 VSO2003 VSO2002
Keywords: kbgraphxlinkcritical kbhowto KB254730