Microsoft KB Archive/254730

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:53, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Article ID: 254730

Article Last Modified on 4/11/2007



APPLIES TO

  • 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

SUMMARY

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.

MORE INFORMATION

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.

  1. While the shape is still selected, click Field on the Insert menu.
  2. On the Category menu, click Custom Formula.
  3. Once chosen, the Custom Formula bar becomes active. Place the mouse pointer in the field and type Prop.Cost.
  4. 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.

  1. While the shape is selected, click Show ShapeSheet on the Window menu.
  2. Scroll to find the Custom Properties section of the ShapeSheet. If it is not visible, click Sections on the View menu. Check custom properties.
  3. 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:

  1. Type the following:

    Cost: $

    Follow steps 1 through 4 in the "A simple example" section earlier in this article. Then press ENTER.
  2. Type the word:

    Duration:

    Follow steps 1 through 4 again and enter the Custom Formula as Prop.Duration. Then press ENTER. If desired, type in the time frame such as "week."
  3. Type

    Resources:

    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:

  1. 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.
  2. Create a new row and name it HideProperties. The value and the prompt for this section should remain unchanged.
  3. Add two additional rows to the end of the Actions section of the ShapeSheet.
  4. Add the following formulas or values to this section.
    Action Actions Menu Prompt Checked Disabled
    2 =SETF

    ("User.HideProperties",0)
    +SETF("Actions.D2",1)
    +SETF("Actions.D3",0)

    Show

    properties

    Show

    custom
    properties

    0 1
    3 =SETF

    ("User.HideProperties",1)
    +SETF("Actions.D3",1)
    +SETF("Actions.D2",0)

    Hide

    properties

    Hide

    custom
    properties

    0 0
    Note In Microsoft Office Visio 2003 or in Microsoft Visio 2002, you cannot find Prompt in the Action section.
  5. In the Miscellaneous section of the ShapeSheet, type the following cell reference in the HideText cell:

    User.HideProperties

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