Protecting Local Shape Formats

3 4

Applying a style can change the formulas in the Line Format, Fill Format, Text Block Format, Character, Paragraph, and Tab ShapeSheet sections for a shape. If they are not protected, local (custom) formulas in the related ShapeSheet cells can be overwritten. For example, you might have written a custom formula in the Size cell of the Character section of a shape in a master to dynamically change the font size of your master based on its text block height. If a user applies a different text style to the shape, the custom formula is overwritten.

You can protect local shape formats by using the Preserve local formatting option in the Style dialog box, by setting the LockFormat cell, or by using the GUARD function to protect formulas.

Preserving Local Shape Formatting through the User Interface

You can protect local shape formatting by selecting the Preserve local formatting check box in the Style dialog box when applying a different style.

When you select Preserve local formatting, the style is applied, but local formatting is maintained. If Preserve local formatting isn't selected, the new style is applied, and any local formatting is overwritten.

Preserving Local Shape Formatting through the ShapeSheet Spreadsheet

Setting the LockFormat cell to 1 in the Protection section of a shape's sheet protects a shape from both formatting and style changes. Using the GUARD function in a formula prevents that cell from changing when a user applies formatting or styles. If you protect a group using the LockFormat cell, you automatically protect the shapes and other groups within it from inheriting formatting; however, users can subselect shapes in the group that are not explicitly locked and change their formatting. For details about protecting formatting in a group, see Chapter 6, Grouping and Merging Shapes.

Use the LockFormat cell and the GUARD function with care. When a shape is locked against formatting, Microsoft Visio automatically displays a message when a user tries to format the shape. In contrast, the GUARD function works without any notification or user messages. Either behavior can confuse or annoy users who want to format a protected shape. As you develop shapes, you must find the appropriate balance between limiting shape behavior and increasing user flexibility in your solution.



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