Partager via


Field Class

Text Field.When the object is serialized out as xml, its qualified name is a:fld.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Drawing.Field

Namespace:  DocumentFormat.OpenXml.Drawing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(ParagraphProperties))> _
<ChildElementInfoAttribute(GetType(Text))> _
<ChildElementInfoAttribute(GetType(RunProperties))> _
Public Class Field _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As Field
[ChildElementInfoAttribute(typeof(ParagraphProperties))]
[ChildElementInfoAttribute(typeof(Text))]
[ChildElementInfoAttribute(typeof(RunProperties))]
public class Field : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • RunProperties <a:rPr>

  • ParagraphProperties <a:pPr>

  • Text <a:t>

[ISO/IEC 29500-1 1st Edition]

21.1.2.2.4 fld (Text Field)

This element specifies a text field which contains generated text that the application should update periodically. Each piece of text when it is generated is given a unique identification number that is used to refer to a specific field. At the time of creation the text field indicates the kind of text that should be used to update this field. This update type is used so that all applications that did not create this text field can still know what kind of text it should be updated with. Thus the new application can then attach an update type to the text field id for continual updating.

[Example: Consider a slide within a presentation that needs to have the slide number placed on the slide. The following DrawingML can be used to describe such a situation.

<p:txBody>
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:fld id="{424CEEAC-8F67-4238-9622-1B74DC6E8318}" type="slidenum">
<a:rPr lang="en-US" smtClean="0"/>
<a:pPr/>
<a:t>3</a:t>
</a:fld>
<a:endParaRPr lang="en-US"/>
</a:p>
</p:txBody>

end example]

Parent Elements

p (§21.1.2.2.6)

Child Elements

Subclause

pPr (Text Paragraph Properties)

§21.1.2.2.7

rPr (Text Run Properties)

§21.1.2.3.9

t (Text String)

§21.1.2.3.11

Attributes

Description

id (Field ID)

Specifies the unique to this document, host specified token that is used to identify the field. This token is generated when the text field is created and persists in the file as the same token until the text field is removed. Any application should check the document for conflicting tokens before assigning a new token to a text field.

The possible values for this attribute are defined by the ST_Guid simple type (§22.9.2.4).

type (Field Type)

Specifies the type of text that should be used to update this text field. This is used to inform the rendering application what text it should use to update this text field. There are no specific syntax restrictions placed on this attribute. The generating application can use it to represent any text that should be updated before rendering the presentation.

Reserved Values:

Value

Description

slidenum

presentation slide number

datetime

default date time format for the rendering application

datetime1

MM/DD/YYYY date time format [Example: 10/12/2007 end example]

datetime2

Day, Month DD, YYYY date time format [Example: Friday, October 12, 2007 end example]

datetime3

DD Month YYYY date time format [Example: 12 October 2007 end example]

datetime4

Month DD, YYYY date time format [Example: October 12, 2007 end example]

datetime5

DD-Mon-YY date time format [Example: 12-Oct-07 end example]

datetime6

Month YY date time format [Example: October 07 end example]

datetime7

Mon-YY date time format [Example: Oct-07 end example]

datetime8

MM/DD/YYYY hh:mm AM/PM date time format [Example: 10/12/2007 4:28 PM end example]

datetime9

MM/DD/YYYY hh:mm:ss AM/PM date time format [Example: 10/12/2007 4:28:34 PM end example]

datetime10

hh:mm date time format [Example: 16:28 end example]

datetime11

hh:mm:ss date time format [Example: 16:28:34 end example]

datetime12

hh:mm AM/PM date time format [Example: 4:28 PM end example]

datetime13

hh:mm:ss: AM/PM date time format [Example: 4:28:34 PM end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_TextField) is located in §A.4.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Field Members

DocumentFormat.OpenXml.Drawing Namespace