# Protection Element

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:

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

## See also

Protection section

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp