com.aspose.words
Class FieldType

java.lang.Object
    extended by com.aspose.words.FieldType

public class FieldType 
extends java.lang.Object

Utility class containing constants. Enumeration that identifies all different types of Word fields.

Example:

Shows how to find the type of field that is represented by a node which is derived from FieldChar.
FieldChar fieldStart = (FieldChar)doc.getChild(NodeType.FIELD_START, 0, true);
int type = fieldStart.getFieldType();

Example:

Inserts a field into a document using DocumentBuilder.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a simple Date field into the document.
// When we insert a field through the DocumentBuilder class we can get the
// special Field object which contains information about the field.
Field dateField = builder.insertField("DATE \\* MERGEFORMAT");

// Update this particular field in the document so we can get the FieldResult.
dateField.update();

// Display some information from this field.
// The field result is where the last evaluated value is stored. This is what is displayed in the document
// When field codes are not showing.
System.out.println(MessageFormat.format("FieldResult: {0}", dateField.getResult()));

// Display the field code which defines the behaviour of the field. This can been seen in Microsoft Word by pressing ALT+F9.
System.out.println(MessageFormat.format("FieldCode: {0}", dateField.getFieldCode()));

// The field type defines what type of field in the Document this is. In this case the type is "FieldDate"
System.out.println(MessageFormat.format("FieldType: {0}", dateField.getType()));

// Finally let's completely remove the field from the document. This can easily be done by invoking the Remove method on the object.
dateField.remove();

Field Summary
static final intFIELD_NONE = 0
           Field type is not specified or unknown.
static final intFIELD_CANNOT_PARSE = 1
           Specifies that the field was unable to be parsed.
static final intFIELD_ADDIN = 81
           Specifies that the field contains data created by an add-in.
static final intFIELD_ADDRESS_BLOCK = 93
           Inserts an address block.
static final intFIELD_ADVANCE = 84
           Offset subsequent text within a line to the left, right, up or down.
static final intFIELD_ASK = 38
           Prompt the user for text to assign to a bookmark.
static final intFIELD_AUTHOR = 17
           The name of the document's author from Summary Info.
static final intFIELD_AUTO_NUM = 54
           Insert an automatic number.
static final intFIELD_AUTO_NUM_LEGAL = 53
           Insert an automatic number in legal format.
static final intFIELD_AUTO_NUM_OUTLINE = 52
           Insert an automatic number in outline format.
static final intFIELD_AUTO_TEXT = 79
           Insert an AutoText entry.
static final intFIELD_AUTO_TEXT_LIST = 89
           Insert text based on style.
static final intFIELD_BAR_CODE = 63
           Insert a delivery point barcode.
static final intFIELD_BIBLIOGRAPHY = 100500
           Inserts a Bibliography part.
static final intFIELD_BIDI_OUTLINE = 92
           Specified in [ECMA-376] part 4, section 2.16.5.12
static final intFIELD_CITATION = 1980
           Inserts a Citation part.
static final intFIELD_COMMENTS = 19
           The comments from Summary Info.
static final intFIELD_COMPARE = 80
           Compares two values.
static final intFIELD_CREATE_DATE = 21
           The date the document was created.
static final intFIELD_DATA = 40
           Specifies that this field should redirect the mail merge data and header files to the ones specified.
static final intFIELD_DATABASE = 78
           Insert data from an external database.
static final intFIELD_DATE = 31
           Today's date.
static final intFIELD_DDE = 45
           Undocumented.
static final intFIELD_DDE_AUTO = 46
           Undocumented.
static final intFIELD_DOC_PROPERTY = 85
           Insert the value of the property.
static final intFIELD_DOC_VARIABLE = 64
           Insert the value of the document variable.
static final intFIELD_EDIT_TIME = 25
           The total document editing time.
static final intFIELD_EMBED = 58
           OLE2 embedded object. Might occur only in files. In the document object, represented by a single shape node.
static final intFIELD_EQUATION = 49
           Create a scientific equation.
static final intFIELD_FILE_NAME = 29
           The document's name and location.
static final intFIELD_FILE_SIZE = 69
           The size on disk of the active document.
static final intFIELD_FILL_IN = 39
           Prompt the user for text to insert in the document.
static final intFIELD_FOOTNOTE_REF = 5
           This field is identical to NOTEREF specified in [ECMA-376] part 4, section 2.16.5.47.
static final intFIELD_FORM_CHECK_BOX = 71
           Check box control.
static final intFIELD_FORM_DROP_DOWN = 83
           Drop down control.
static final intFIELD_FORM_TEXT_INPUT = 70
           Text control.
static final intFIELD_FORMULA = 34
           Calculates the result of an expression.
static final intFIELD_GREETING_LINE = 94
           Specified in [ECMA-376] part 4, section 2.16.5.30
static final intFIELD_GLOSSARY = 47
           This field is identical to AUTOTEXT specified in [ECMA-376] part 4, section 2.16.5.8
static final intFIELD_GO_TO_BUTTON = 50
           Move the insertion point to a new location.
static final intFIELD_HTML_ACTIVE_X = 91
           Specifies the field represents an HTML control.
static final intFIELD_HYPERLINK = 88
           Open and jump to the specified file.
static final intFIELD_IF = 7
           Evaluate arguments conditionally.
static final intFIELD_INCLUDE = 36
           This field is identical to INCLUDETEXT specified in [ECMA-376] part 4, section 2.16.5.34
static final intFIELD_INCLUDE_PICTURE = 67
           "INCLUDEPICTURE", Insert a picture from a file. Might occur only in files. In the document object, represented by a single shape node.
static final intFIELD_INCLUDE_TEXT = 68
           Insert text from a file.
static final intFIELD_INDEX = 8
           Create an index.
static final intFIELD_INDEX_ENTRY = 4
           Mark an index entry.
static final intFIELD_INFO = 14
           Data from Summary Info.
static final intFIELD_IMPORT = 55
           Specified in [ECMA-376] part 4, section 2.16.5.33
static final intFIELD_KEYWORD = 18
           The keywords from Summary Info.
static final intFIELD_LAST_SAVED_BY = 20
           Name of user who last saved the document.
static final intFIELD_LINK = 56
          

Linked OLE2 object.

The LINK field in the file can be with an image or without. Aspose.Words represents a LINK field with an image and without differently in the model. A LINK field with an image will be represented by a Shape object and no field. A LINK field without an image will be represented as a normal field.

static final intFIELD_LIST_NUM = 90
           Insert an element in a list.
static final intFIELD_MACRO_BUTTON = 51
           Run a macro.
static final intFIELD_MERGE_FIELD = 59
           Insert a mail merge field.
static final intFIELD_MERGE_REC = 44
           The number of the current merge record.
static final intFIELD_MERGE_SEQ = 75
           Merge record sequence number.
static final intFIELD_NEXT = 41
           Go to the next record in a mail merge.
static final intFIELD_NEXT_IF = 42
           Conditionally go to the next record in a mail merge.
static final intFIELD_NOTE_REF = 72
           Insert the number of a footnote or endnote.
static final intFIELD_NUM_CHARS = 28
           The number of characters in the document.
static final intFIELD_NUM_PAGES = 26
           The number of pages in the document.
static final intFIELD_NUM_WORDS = 27
           The number of words in the document.
static final intFIELD_OCX = 87
          

Represents an ActiveX control such as a command button etc.

Normally, Aspose.Words will represent an ActiveX control as a Shape object, but for some documents, where a control does not have data and/or seems to be invalid, it will be represented as a field.

static final intFIELD_PAGE = 33
           Insert the number of the current page.
static final intFIELD_PAGE_REF = 37
           Insert the number of the page containing the specified bookmark.
static final intFIELD_PRINT = 48
           Download commands to a printer.
static final intFIELD_PRINT_DATE = 23
           The date the document was last printed.
static final intFIELD_PRIVATE = 77
           Stores data for documents converted from other file formats. Microsoft Word inserts a PRIVATE field when converting file formats; the field contains data needed for converting a document back to its original file format. A PRIVATE field is formatted as hidden text and doesn't affect the document layout.
static final intFIELD_QUOTE = 35
           Insert literal text.
static final intFIELD_REF = 3
           Insert the text marked by a bookmark.
static final intFIELD_REF_NO_KEYWORD = 2
           Specifies that the field represents a REF field where the keyword has been omitted.
static final intFIELD_REF_DOC = 11
           Create an index, table of contents, table of figures, and/or table of authorities by using multiple documents.
static final intFIELD_REVISION_NUM = 24
           Insert the number of times the document has been saved.
static final intFIELD_SAVE_DATE = 22
           The date the document was last saved.
static final intFIELD_SECTION = 65
           Insert the number of the current section.
static final intFIELD_SECTION_PAGES = 66
           Insert the total number of pages in the section.
static final intFIELD_SEQUENCE = 12
           Insert an automatic sequence number.
static final intFIELD_SET = 6
           Assign new text to a bookmark.
static final intFIELD_SHAPE = 95
           Represents an inline shape in the document. Might occur only in files. In the document object, represented by a single shape node.
static final intFIELD_SKIP_IF = 43
           Conditionally skip a record in a mail merge.
static final intFIELD_STYLE_REF = 10
           Insert the text from a like-style paragraph.
static final intFIELD_SUBJECT = 16
           The document's subject from Summary Info.
static final intFIELD_SYMBOL = 57
           Insert a special character.
static final intFIELD_TEMPLATE = 30
           The name of the template attached to the document.
static final intFIELD_TIME = 32
           The current time.
static final intFIELD_TITLE = 15
           The document's title from Summary Info.
static final intFIELD_TOA = 73
           Create a table of authorities.
static final intFIELD_TOA_ENTRY = 74
           Make a table of authorities entry.
static final intFIELD_TOC = 13
           Create a table of contents.
static final intFIELD_TOC_ENTRY = 9
           Make a table of contents entry.
static final intFIELD_USER_ADDRESS = 62
           Address from Tools Options User Info.
static final intFIELD_USER_INITIALS = 61
           Initials form Tools Options User Info.
static final intFIELD_USER_NAME = 60
           Name from Tools Options User Info.
 

Field Detail

FIELD_NONE = 0

public static final int FIELD_NONE
Field type is not specified or unknown.

FIELD_CANNOT_PARSE = 1

public static final int FIELD_CANNOT_PARSE
Specifies that the field was unable to be parsed.

FIELD_ADDIN = 81

public static final int FIELD_ADDIN
Specifies that the field contains data created by an add-in.

FIELD_ADDRESS_BLOCK = 93

public static final int FIELD_ADDRESS_BLOCK
Inserts an address block.

FIELD_ADVANCE = 84

public static final int FIELD_ADVANCE
Offset subsequent text within a line to the left, right, up or down.

FIELD_ASK = 38

public static final int FIELD_ASK
Prompt the user for text to assign to a bookmark.

FIELD_AUTHOR = 17

public static final int FIELD_AUTHOR
The name of the document's author from Summary Info.

FIELD_AUTO_NUM = 54

public static final int FIELD_AUTO_NUM
Insert an automatic number.

FIELD_AUTO_NUM_LEGAL = 53

public static final int FIELD_AUTO_NUM_LEGAL
Insert an automatic number in legal format.

FIELD_AUTO_NUM_OUTLINE = 52

public static final int FIELD_AUTO_NUM_OUTLINE
Insert an automatic number in outline format.

FIELD_AUTO_TEXT = 79

public static final int FIELD_AUTO_TEXT
Insert an AutoText entry.

FIELD_AUTO_TEXT_LIST = 89

public static final int FIELD_AUTO_TEXT_LIST
Insert text based on style.

FIELD_BAR_CODE = 63

public static final int FIELD_BAR_CODE
Insert a delivery point barcode.

FIELD_BIBLIOGRAPHY = 100500

public static final int FIELD_BIBLIOGRAPHY
Inserts a Bibliography part.

FIELD_BIDI_OUTLINE = 92

public static final int FIELD_BIDI_OUTLINE
Specified in [ECMA-376] part 4, section 2.16.5.12

FIELD_CITATION = 1980

public static final int FIELD_CITATION
Inserts a Citation part.

FIELD_COMMENTS = 19

public static final int FIELD_COMMENTS
The comments from Summary Info.

FIELD_COMPARE = 80

public static final int FIELD_COMPARE
Compares two values.

FIELD_CREATE_DATE = 21

public static final int FIELD_CREATE_DATE
The date the document was created.

FIELD_DATA = 40

public static final int FIELD_DATA
Specifies that this field should redirect the mail merge data and header files to the ones specified.

FIELD_DATABASE = 78

public static final int FIELD_DATABASE
Insert data from an external database.

FIELD_DATE = 31

public static final int FIELD_DATE
Today's date.

FIELD_DDE = 45

public static final int FIELD_DDE
Undocumented.

FIELD_DDE_AUTO = 46

public static final int FIELD_DDE_AUTO
Undocumented.

FIELD_DOC_PROPERTY = 85

public static final int FIELD_DOC_PROPERTY
Insert the value of the property.

FIELD_DOC_VARIABLE = 64

public static final int FIELD_DOC_VARIABLE
Insert the value of the document variable.

FIELD_EDIT_TIME = 25

public static final int FIELD_EDIT_TIME
The total document editing time.

FIELD_EMBED = 58

public static final int FIELD_EMBED
OLE2 embedded object. Might occur only in files. In the document object, represented by a single shape node.

FIELD_EQUATION = 49

public static final int FIELD_EQUATION
Create a scientific equation.

FIELD_FILE_NAME = 29

public static final int FIELD_FILE_NAME
The document's name and location.

FIELD_FILE_SIZE = 69

public static final int FIELD_FILE_SIZE
The size on disk of the active document.

FIELD_FILL_IN = 39

public static final int FIELD_FILL_IN
Prompt the user for text to insert in the document.

FIELD_FOOTNOTE_REF = 5

public static final int FIELD_FOOTNOTE_REF
This field is identical to NOTEREF specified in [ECMA-376] part 4, section 2.16.5.47.

FIELD_FORM_CHECK_BOX = 71

public static final int FIELD_FORM_CHECK_BOX
Check box control.

FIELD_FORM_DROP_DOWN = 83

public static final int FIELD_FORM_DROP_DOWN
Drop down control.

FIELD_FORM_TEXT_INPUT = 70

public static final int FIELD_FORM_TEXT_INPUT
Text control.

FIELD_FORMULA = 34

public static final int FIELD_FORMULA
Calculates the result of an expression.

FIELD_GREETING_LINE = 94

public static final int FIELD_GREETING_LINE
Specified in [ECMA-376] part 4, section 2.16.5.30

FIELD_GLOSSARY = 47

public static final int FIELD_GLOSSARY
This field is identical to AUTOTEXT specified in [ECMA-376] part 4, section 2.16.5.8

FIELD_GO_TO_BUTTON = 50

public static final int FIELD_GO_TO_BUTTON
Move the insertion point to a new location.

FIELD_HTML_ACTIVE_X = 91

public static final int FIELD_HTML_ACTIVE_X
Specifies the field represents an HTML control.

FIELD_HYPERLINK = 88

public static final int FIELD_HYPERLINK
Open and jump to the specified file.

FIELD_IF = 7

public static final int FIELD_IF
Evaluate arguments conditionally.

FIELD_INCLUDE = 36

public static final int FIELD_INCLUDE
This field is identical to INCLUDETEXT specified in [ECMA-376] part 4, section 2.16.5.34

FIELD_INCLUDE_PICTURE = 67

public static final int FIELD_INCLUDE_PICTURE
"INCLUDEPICTURE", Insert a picture from a file. Might occur only in files. In the document object, represented by a single shape node.

FIELD_INCLUDE_TEXT = 68

public static final int FIELD_INCLUDE_TEXT
Insert text from a file.

FIELD_INDEX = 8

public static final int FIELD_INDEX
Create an index.

FIELD_INDEX_ENTRY = 4

public static final int FIELD_INDEX_ENTRY
Mark an index entry.

FIELD_INFO = 14

public static final int FIELD_INFO
Data from Summary Info.

FIELD_IMPORT = 55

public static final int FIELD_IMPORT
Specified in [ECMA-376] part 4, section 2.16.5.33

FIELD_KEYWORD = 18

public static final int FIELD_KEYWORD
The keywords from Summary Info.

FIELD_LAST_SAVED_BY = 20

public static final int FIELD_LAST_SAVED_BY
Name of user who last saved the document.

FIELD_LINK = 56

public static final int FIELD_LINK

Linked OLE2 object.

The LINK field in the file can be with an image or without. Aspose.Words represents a LINK field with an image and without differently in the model. A LINK field with an image will be represented by a Shape object and no field. A LINK field without an image will be represented as a normal field.


FIELD_LIST_NUM = 90

public static final int FIELD_LIST_NUM
Insert an element in a list.

FIELD_MACRO_BUTTON = 51

public static final int FIELD_MACRO_BUTTON
Run a macro.

FIELD_MERGE_FIELD = 59

public static final int FIELD_MERGE_FIELD
Insert a mail merge field.

FIELD_MERGE_REC = 44

public static final int FIELD_MERGE_REC
The number of the current merge record.

FIELD_MERGE_SEQ = 75

public static final int FIELD_MERGE_SEQ
Merge record sequence number.

FIELD_NEXT = 41

public static final int FIELD_NEXT
Go to the next record in a mail merge.

FIELD_NEXT_IF = 42

public static final int FIELD_NEXT_IF
Conditionally go to the next record in a mail merge.

FIELD_NOTE_REF = 72

public static final int FIELD_NOTE_REF
Insert the number of a footnote or endnote.

FIELD_NUM_CHARS = 28

public static final int FIELD_NUM_CHARS
The number of characters in the document.

FIELD_NUM_PAGES = 26

public static final int FIELD_NUM_PAGES
The number of pages in the document.

FIELD_NUM_WORDS = 27

public static final int FIELD_NUM_WORDS
The number of words in the document.

FIELD_OCX = 87

public static final int FIELD_OCX

Represents an ActiveX control such as a command button etc.

Normally, Aspose.Words will represent an ActiveX control as a Shape object, but for some documents, where a control does not have data and/or seems to be invalid, it will be represented as a field.


FIELD_PAGE = 33

public static final int FIELD_PAGE
Insert the number of the current page.

FIELD_PAGE_REF = 37

public static final int FIELD_PAGE_REF
Insert the number of the page containing the specified bookmark.

FIELD_PRINT = 48

public static final int FIELD_PRINT
Download commands to a printer.

FIELD_PRINT_DATE = 23

public static final int FIELD_PRINT_DATE
The date the document was last printed.

FIELD_PRIVATE = 77

public static final int FIELD_PRIVATE
Stores data for documents converted from other file formats. Microsoft Word inserts a PRIVATE field when converting file formats; the field contains data needed for converting a document back to its original file format. A PRIVATE field is formatted as hidden text and doesn't affect the document layout.

FIELD_QUOTE = 35

public static final int FIELD_QUOTE
Insert literal text.

FIELD_REF = 3

public static final int FIELD_REF
Insert the text marked by a bookmark.

FIELD_REF_NO_KEYWORD = 2

public static final int FIELD_REF_NO_KEYWORD
Specifies that the field represents a REF field where the keyword has been omitted.

FIELD_REF_DOC = 11

public static final int FIELD_REF_DOC
Create an index, table of contents, table of figures, and/or table of authorities by using multiple documents.

FIELD_REVISION_NUM = 24

public static final int FIELD_REVISION_NUM
Insert the number of times the document has been saved.

FIELD_SAVE_DATE = 22

public static final int FIELD_SAVE_DATE
The date the document was last saved.

FIELD_SECTION = 65

public static final int FIELD_SECTION
Insert the number of the current section.

FIELD_SECTION_PAGES = 66

public static final int FIELD_SECTION_PAGES
Insert the total number of pages in the section.

FIELD_SEQUENCE = 12

public static final int FIELD_SEQUENCE
Insert an automatic sequence number.

FIELD_SET = 6

public static final int FIELD_SET
Assign new text to a bookmark.

FIELD_SHAPE = 95

public static final int FIELD_SHAPE
Represents an inline shape in the document. Might occur only in files. In the document object, represented by a single shape node.

FIELD_SKIP_IF = 43

public static final int FIELD_SKIP_IF
Conditionally skip a record in a mail merge.

FIELD_STYLE_REF = 10

public static final int FIELD_STYLE_REF
Insert the text from a like-style paragraph.

FIELD_SUBJECT = 16

public static final int FIELD_SUBJECT
The document's subject from Summary Info.

FIELD_SYMBOL = 57

public static final int FIELD_SYMBOL
Insert a special character.

FIELD_TEMPLATE = 30

public static final int FIELD_TEMPLATE
The name of the template attached to the document.

FIELD_TIME = 32

public static final int FIELD_TIME
The current time.

FIELD_TITLE = 15

public static final int FIELD_TITLE
The document's title from Summary Info.

FIELD_TOA = 73

public static final int FIELD_TOA
Create a table of authorities.

FIELD_TOA_ENTRY = 74

public static final int FIELD_TOA_ENTRY
Make a table of authorities entry.

FIELD_TOC = 13

public static final int FIELD_TOC
Create a table of contents.

FIELD_TOC_ENTRY = 9

public static final int FIELD_TOC_ENTRY
Make a table of contents entry.

FIELD_USER_ADDRESS = 62

public static final int FIELD_USER_ADDRESS
Address from Tools Options User Info.

FIELD_USER_INITIALS = 61

public static final int FIELD_USER_INITIALS
Initials form Tools Options User Info.

FIELD_USER_NAME = 60

public static final int FIELD_USER_NAME
Name from Tools Options User Info.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.