Share via


Protection Element

Visio XML Reference

Contains elements specifying the current lock settings for a shape.

Locking helps prevent inadvertent changes to the shape but does not prevent Microsoft Office Visio from resetting values in other circumstances. It also does not protect against changes made in the ShapeSheet window.

Syntax

  <Protection
    [Del]>
</Protection>

Attributes

Del

Optional boolean. A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally.

Element properties

Property Value
Name Protection
Minimum Occurrences 0
Maximum Occurrences 1

Element information

Parent elements

PageSheet

Shape

StyleSheet

DocumentSheet

Child elements

LockWidth

LockHeight

LockMoveX

LockMoveY

LockAspect

LockDelete

LockBegin

LockEnd

LockRotate

LockCrop

LockVtxEdit

LockTextEdit

LockFormat

LockGroup

LockCalcWH

LockSelect

LockCustProp

Remarks

To protect a formula from being changed by Visio under any circumstances, use the GUARD function.

The Protection element is relevant only when contained in a Shape or StyleSheet element. It is ignored when contained in a DocumentSheet or PageSheet element.

Example

The following code shows how to prevent Visio from changing a formula that sets the Width element equal to the Height element:

XML
  <Width F="GUARD(Height)">1</Width>

See also

Protection section