# Format Element

Contents vary depending on whether the Format element is contained in a Field or Prop element.

When contained in a Field element, the Format element specifies the formatting for a text field that is a string, number, date or time, duration, or currency. The text field type is specified in the corresponding Type element.

When contained in a Prop element, the Format element specifies the formatting of a custom property that is a string, fixed list, number, variable list, date or time, duration, or currency. The custom property type is specified in the corresponding Type element.

If the value of the Type element is 0, 2, 5, 6, or 7 (string, number, date or time, duration, or currency), specify a format picture appropriate for the data type. For example, the format picture "# #/4 UU" formats the number 12.43 in. as 12 2/4 INCHES.

A number (where the Type element is set to 2) can represent a dimension, scalar, angle, date or time, or currency. To ensure that an input number is always evaluated as a date or time, or currency, use the DATETIME or CY function in the Format element instead of a format picture.

## Syntax

    <Format>
        [Unit]
        [F]
        [Err]>
    </Format>

## Attributes

Unit

Optional string. Represents a unit of measure. The default is NUM. For details about NUM, see Units of measure.

F

Optional string. Represents the element's formula. This attribute can contain one of the following strings: "someFormula" if the formula exists locally, "No Formula" if the formula is locally deleted or blocked, or "Inh" if the formula is inherited.

If the attribute is not present, the element's formula is a simple constant, for example, <element>5</element>.

Err

Optional string. Indicates that the formula evaluates to an error. The value of Err is the current value (an error message string); the value of the element is the last valid value.

## Element properties

Property | Value
--- | ---
Name | Format
Minimum Occurrences | 0
Maximum Occurrences | 1

## Element information

Parent elements

Field

Prop

Child elements

None

## Remarks

Format pictures are used to determine how a value will be displayed. For example, you can control the number of digits displayed to the right or left of a decimal point, or whether a text string appears as uppercase or lowercase. For more information, including formatting symbols, see About format pictures in the Microsoft Office Visio 2003 ShapeSheet Reference.

Format pictures are strings; if you specify a format picture in this element, the element's Unit attribute should be specified as STR (the default is NUM).

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

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

## See also

Format cell (Custom Properties section)

Format cell (Text Fields 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