com.aspose.words

Class FieldType

  • java.lang.Object
    • com.aspose.words.FieldType
public class FieldType 
extends java.lang.Object

Utility class containing constants. Specifies Microsoft Word field types.

Example:

Shows how to insert a field into a document using a field code.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Field dateField = builder.insertField("DATE \\* MERGEFORMAT");

Assert.assertEquals(FieldType.FIELD_DATE, dateField.getType());
Assert.assertEquals("DATE \\* MERGEFORMAT", dateField.getFieldCode());

Example:

Shows how to work with a FieldStart node.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

FieldDate field = (FieldDate) builder.insertField(FieldType.FIELD_DATE, true);
field.getFormat().setDateTimeFormat("dddd, MMMM dd, yyyy");
field.update();

FieldChar fieldStart = field.getStart();

Assert.assertEquals(FieldType.FIELD_DATE, fieldStart.getFieldType());
Assert.assertEquals(false, fieldStart.isDirty());
Assert.assertEquals(false, fieldStart.isLocked());

// Retrieve the facade object which represents the field in the document.
field = (FieldDate)fieldStart.getField();

Assert.assertEquals(false, field.isLocked());
Assert.assertEquals(" DATE  \\@ \"dddd, MMMM dd, yyyy\"", field.getFieldCode());

// Update the field to show the current date.
field.update();

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 the ADDIN field.
static final intFIELD_ADDRESS_BLOCK = 93
Specifies the ADDRESSBLOCK field.
static final intFIELD_ADVANCE = 84
Specifies the ADVANCE field.
static final intFIELD_ASK = 38
Specifies the ASK field.
static final intFIELD_AUTHOR = 17
Specifies the AUTHOR field.
static final intFIELD_AUTO_NUM = 54
Specifies the AUTONUM field.
static final intFIELD_AUTO_NUM_LEGAL = 53
Specifies the AUTONUMLGL field.
static final intFIELD_AUTO_NUM_OUTLINE = 52
Specifies the AUTONUMOUT field.
static final intFIELD_AUTO_TEXT = 79
Specifies the AUTOTEXT field.
static final intFIELD_AUTO_TEXT_LIST = 89
Specifies the AUTOTEXTLIST field.
static final intFIELD_BARCODE = 63
Specifies the BARCODE field.
static final intFIELD_BIBLIOGRAPHY = 100500
Specifies the BIBLIOGRAPHY field.
static final intFIELD_BIDI_OUTLINE = 92
Specifies the BIDIOUTLINE field.
static final intFIELD_CITATION = 1980
Specifies the CITATION field.
static final intFIELD_COMMENTS = 19
Specifies the COMMENTS field.
static final intFIELD_COMPARE = 80
Specifies the COMPARE field.
static final intFIELD_CREATE_DATE = 21
Specifies the CREATEDATE field.
static final intFIELD_DATA = 40
Specifies the DATA field.
static final intFIELD_DATABASE = 78
Specifies the DATABASE field.
static final intFIELD_DATE = 31
Specifies the DATE field.
static final intFIELD_DDE = 45
Specifies the DDE field.
static final intFIELD_DISPLAY_BARCODE = 6301
Specifies the DISPLAYBARCODE field.
static final intFIELD_MERGE_BARCODE = 6302
Specifies the MERGEBARCODE field.
static final intFIELD_DDE_AUTO = 46
Specifies the DDEAUTO field.
static final intFIELD_DOC_PROPERTY = 85
Specifies the DOCPROPERTY field.
static final intFIELD_DOC_VARIABLE = 64
Specifies the DOCVARIABLE field.
static final intFIELD_EDIT_TIME = 25
Specifies the EDITTIME field.
static final intFIELD_EMBED = 58
Specifies the EMBED field.
static final intFIELD_EQUATION = 49
Specifies the EQ field.
static final intFIELD_FILE_NAME = 29
Specifies the FILENAME field.
static final intFIELD_FILE_SIZE = 69
Specifies the FILESIZE field.
static final intFIELD_FILL_IN = 39
Specifies the FILLIN field.
static final intFIELD_FOOTNOTE_REF = 5
Specifies the FOOTNOTEREF field.
static final intFIELD_FORM_CHECK_BOX = 71
Specifies the FORMCHECKBOX field.
static final intFIELD_FORM_DROP_DOWN = 83
Specifies the FORMDROPDOWN field.
static final intFIELD_FORM_TEXT_INPUT = 70
Specifies the FORMTEXT field.
static final intFIELD_FORMULA = 34
Specifies the = (formula) field.
static final intFIELD_GREETING_LINE = 94
Specifies the GREETINGLINE field.
static final intFIELD_GLOSSARY = 47
Specifies the GLOSSARY field.
static final intFIELD_GO_TO_BUTTON = 50
Specifies the GOTOBUTTON field.
static final intFIELD_HTML_ACTIVE_X = 91
Specifies the field that represents an HTML control.
static final intFIELD_HYPERLINK = 88
Specifies the HYPERLINK field.
static final intFIELD_IF = 7
Specifies the IF field.
static final intFIELD_INCLUDE = 36
Specifies the INCLUDE field.
static final intFIELD_INCLUDE_PICTURE = 67
Specifies the INCLUDEPICTURE field.
static final intFIELD_INCLUDE_TEXT = 68
Specifies the INCLUDETEXT field.
static final intFIELD_INDEX = 8
Specifies the INDEX field.
static final intFIELD_INDEX_ENTRY = 4
Specifies the XE field.
static final intFIELD_INFO = 14
Specifies the INFO field.
static final intFIELD_IMPORT = 55
Specifies the IMPORT field.
static final intFIELD_KEYWORD = 18
Specifies the KEYWORDS field.
static final intFIELD_LAST_SAVED_BY = 20
Specifies the LASTSAVEDBY field.
static final intFIELD_LINK = 56
Specifies the LINK field.
static final intFIELD_LIST_NUM = 90
Specifies the LISTNUM field.
static final intFIELD_MACRO_BUTTON = 51
Specifies the MACROBUTTON field.
static final intFIELD_MERGE_FIELD = 59
Specifies the MERGEFIELD field.
static final intFIELD_MERGE_REC = 44
Specifies the MERGEREC field.
static final intFIELD_MERGE_SEQ = 75
Specifies the MERGESEQ field.
static final intFIELD_NEXT = 41
Specifies the NEXT field.
static final intFIELD_NEXT_IF = 42
Specifies the NEXTIF field.
static final intFIELD_NOTE_REF = 72
Specifies the NOTEREF field.
static final intFIELD_NUM_CHARS = 28
Specifies the NUMCHARS field.
static final intFIELD_NUM_PAGES = 26
Specifies the NUMPAGES field.
static final intFIELD_NUM_WORDS = 27
Specifies the NUMWORDS field.
static final intFIELD_OCX = 87

Specifies the OCX field.

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
Specifies the PAGE field.
static final intFIELD_PAGE_REF = 37
Specifies the PAGEREF field.
static final intFIELD_PRINT = 48
Specifies the PRINT field.
static final intFIELD_PRINT_DATE = 23
Specifies the PRINTDATE field.
static final intFIELD_PRIVATE = 77
Specifies the PRIVATE field.
static final intFIELD_QUOTE = 35
Specifies the QUOTE field.
static final intFIELD_REF = 3
Specifies the REF field.
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
Specifies the RD field.
static final intFIELD_REVISION_NUM = 24
Specifies the REVNUM field.
static final intFIELD_SAVE_DATE = 22
Specifies the SAVEDATE field.
static final intFIELD_SECTION = 65
Specifies the SECTION field.
static final intFIELD_SECTION_PAGES = 66
Specifies the SECTIONPAGES field.
static final intFIELD_SEQUENCE = 12
Specifies the SEQ field.
static final intFIELD_SET = 6
Specifies the SET field.
static final intFIELD_SHAPE = 95
Specifies the SHAPE field.
static final intFIELD_SKIP_IF = 43
Specifies the SKIPIF field.
static final intFIELD_STYLE_REF = 10
Specifies the STYLEREF field.
static final intFIELD_SUBJECT = 16
Specifies the SUBJECT field.
static final intFIELD_SYMBOL = 57
Specifies the SYMBOL field.
static final intFIELD_TEMPLATE = 30
Specifies the TEMPLATE field.
static final intFIELD_TIME = 32
Specifies the TIME field.
static final intFIELD_TITLE = 15
Specifies the TITLE field.
static final intFIELD_TOA = 73
Specifies the TOA field.
static final intFIELD_TOA_ENTRY = 74
Specifies the TA field.
static final intFIELD_TOC = 13
Specifies the TOC field.
static final intFIELD_TOC_ENTRY = 9
Specifies the TC field.
static final intFIELD_USER_ADDRESS = 62
Specifies the USERADDRESS field.
static final intFIELD_USER_INITIALS = 61
Specifies the USERINITIALS field.
static final intFIELD_USER_NAME = 60
Specifies the USERNAME field.
 

    • 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 the ADDIN field.
      • FIELD_ADDRESS_BLOCK = 93

        public static final int FIELD_ADDRESS_BLOCK
        Specifies the ADDRESSBLOCK field.
      • FIELD_ADVANCE = 84

        public static final int FIELD_ADVANCE
        Specifies the ADVANCE field.
      • FIELD_ASK = 38

        public static final int FIELD_ASK
        Specifies the ASK field.
      • FIELD_AUTHOR = 17

        public static final int FIELD_AUTHOR
        Specifies the AUTHOR field.
      • FIELD_AUTO_NUM = 54

        public static final int FIELD_AUTO_NUM
        Specifies the AUTONUM field.
      • FIELD_AUTO_NUM_LEGAL = 53

        public static final int FIELD_AUTO_NUM_LEGAL
        Specifies the AUTONUMLGL field.
      • FIELD_AUTO_NUM_OUTLINE = 52

        public static final int FIELD_AUTO_NUM_OUTLINE
        Specifies the AUTONUMOUT field.
      • FIELD_AUTO_TEXT = 79

        public static final int FIELD_AUTO_TEXT
        Specifies the AUTOTEXT field.
      • FIELD_AUTO_TEXT_LIST = 89

        public static final int FIELD_AUTO_TEXT_LIST
        Specifies the AUTOTEXTLIST field.
      • FIELD_BARCODE = 63

        public static final int FIELD_BARCODE
        Specifies the BARCODE field.
      • FIELD_BIBLIOGRAPHY = 100500

        public static final int FIELD_BIBLIOGRAPHY
        Specifies the BIBLIOGRAPHY field.
      • FIELD_BIDI_OUTLINE = 92

        public static final int FIELD_BIDI_OUTLINE
        Specifies the BIDIOUTLINE field.
      • FIELD_CITATION = 1980

        public static final int FIELD_CITATION
        Specifies the CITATION field.
      • FIELD_COMMENTS = 19

        public static final int FIELD_COMMENTS
        Specifies the COMMENTS field.
      • FIELD_COMPARE = 80

        public static final int FIELD_COMPARE
        Specifies the COMPARE field.
      • FIELD_CREATE_DATE = 21

        public static final int FIELD_CREATE_DATE
        Specifies the CREATEDATE field.
      • FIELD_DATA = 40

        public static final int FIELD_DATA
        Specifies the DATA field.
      • FIELD_DATABASE = 78

        public static final int FIELD_DATABASE
        Specifies the DATABASE field.
      • FIELD_DATE = 31

        public static final int FIELD_DATE
        Specifies the DATE field.
      • FIELD_DDE = 45

        public static final int FIELD_DDE
        Specifies the DDE field.
      • FIELD_DISPLAY_BARCODE = 6301

        public static final int FIELD_DISPLAY_BARCODE
        Specifies the DISPLAYBARCODE field.
      • FIELD_MERGE_BARCODE = 6302

        public static final int FIELD_MERGE_BARCODE
        Specifies the MERGEBARCODE field.
      • FIELD_DDE_AUTO = 46

        public static final int FIELD_DDE_AUTO
        Specifies the DDEAUTO field.
      • FIELD_DOC_PROPERTY = 85

        public static final int FIELD_DOC_PROPERTY
        Specifies the DOCPROPERTY field.
      • FIELD_DOC_VARIABLE = 64

        public static final int FIELD_DOC_VARIABLE
        Specifies the DOCVARIABLE field.
      • FIELD_EDIT_TIME = 25

        public static final int FIELD_EDIT_TIME
        Specifies the EDITTIME field.
      • FIELD_EMBED = 58

        public static final int FIELD_EMBED
        Specifies the EMBED field.
      • FIELD_EQUATION = 49

        public static final int FIELD_EQUATION
        Specifies the EQ field.
      • FIELD_FILE_NAME = 29

        public static final int FIELD_FILE_NAME
        Specifies the FILENAME field.
      • FIELD_FILE_SIZE = 69

        public static final int FIELD_FILE_SIZE
        Specifies the FILESIZE field.
      • FIELD_FILL_IN = 39

        public static final int FIELD_FILL_IN
        Specifies the FILLIN field.
      • FIELD_FOOTNOTE_REF = 5

        public static final int FIELD_FOOTNOTE_REF
        Specifies the FOOTNOTEREF field.
      • FIELD_FORM_CHECK_BOX = 71

        public static final int FIELD_FORM_CHECK_BOX
        Specifies the FORMCHECKBOX field.
      • FIELD_FORM_DROP_DOWN = 83

        public static final int FIELD_FORM_DROP_DOWN
        Specifies the FORMDROPDOWN field.
      • FIELD_FORM_TEXT_INPUT = 70

        public static final int FIELD_FORM_TEXT_INPUT
        Specifies the FORMTEXT field.
      • FIELD_FORMULA = 34

        public static final int FIELD_FORMULA
        Specifies the = (formula) field.
      • FIELD_GREETING_LINE = 94

        public static final int FIELD_GREETING_LINE
        Specifies the GREETINGLINE field.
      • FIELD_GLOSSARY = 47

        public static final int FIELD_GLOSSARY
        Specifies the GLOSSARY field.
      • FIELD_GO_TO_BUTTON = 50

        public static final int FIELD_GO_TO_BUTTON
        Specifies the GOTOBUTTON field.
      • FIELD_HTML_ACTIVE_X = 91

        public static final int FIELD_HTML_ACTIVE_X
        Specifies the field that represents an HTML control.
      • FIELD_HYPERLINK = 88

        public static final int FIELD_HYPERLINK
        Specifies the HYPERLINK field.
      • FIELD_IF = 7

        public static final int FIELD_IF
        Specifies the IF field.
      • FIELD_INCLUDE = 36

        public static final int FIELD_INCLUDE
        Specifies the INCLUDE field.
      • FIELD_INCLUDE_PICTURE = 67

        public static final int FIELD_INCLUDE_PICTURE
        Specifies the INCLUDEPICTURE field.
      • FIELD_INCLUDE_TEXT = 68

        public static final int FIELD_INCLUDE_TEXT
        Specifies the INCLUDETEXT field.
      • FIELD_INDEX = 8

        public static final int FIELD_INDEX
        Specifies the INDEX field.
      • FIELD_INDEX_ENTRY = 4

        public static final int FIELD_INDEX_ENTRY
        Specifies the XE field.
      • FIELD_INFO = 14

        public static final int FIELD_INFO
        Specifies the INFO field.
      • FIELD_IMPORT = 55

        public static final int FIELD_IMPORT
        Specifies the IMPORT field.
      • FIELD_KEYWORD = 18

        public static final int FIELD_KEYWORD
        Specifies the KEYWORDS field.
      • FIELD_LAST_SAVED_BY = 20

        public static final int FIELD_LAST_SAVED_BY
        Specifies the LASTSAVEDBY field.
      • FIELD_LINK = 56

        public static final int FIELD_LINK
        Specifies the LINK field.
      • FIELD_LIST_NUM = 90

        public static final int FIELD_LIST_NUM
        Specifies the LISTNUM field.
      • FIELD_MACRO_BUTTON = 51

        public static final int FIELD_MACRO_BUTTON
        Specifies the MACROBUTTON field.
      • FIELD_MERGE_FIELD = 59

        public static final int FIELD_MERGE_FIELD
        Specifies the MERGEFIELD field.
      • FIELD_MERGE_REC = 44

        public static final int FIELD_MERGE_REC
        Specifies the MERGEREC field.
      • FIELD_MERGE_SEQ = 75

        public static final int FIELD_MERGE_SEQ
        Specifies the MERGESEQ field.
      • FIELD_NEXT = 41

        public static final int FIELD_NEXT
        Specifies the NEXT field.
      • FIELD_NEXT_IF = 42

        public static final int FIELD_NEXT_IF
        Specifies the NEXTIF field.
      • FIELD_NOTE_REF = 72

        public static final int FIELD_NOTE_REF
        Specifies the NOTEREF field.
      • FIELD_NUM_CHARS = 28

        public static final int FIELD_NUM_CHARS
        Specifies the NUMCHARS field.
      • FIELD_NUM_PAGES = 26

        public static final int FIELD_NUM_PAGES
        Specifies the NUMPAGES field.
      • FIELD_NUM_WORDS = 27

        public static final int FIELD_NUM_WORDS
        Specifies the NUMWORDS field.
      • FIELD_OCX = 87

        public static final int FIELD_OCX

        Specifies the OCX field.

        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
        Specifies the PAGE field.
      • FIELD_PAGE_REF = 37

        public static final int FIELD_PAGE_REF
        Specifies the PAGEREF field.
      • FIELD_PRINT = 48

        public static final int FIELD_PRINT
        Specifies the PRINT field.
      • FIELD_PRINT_DATE = 23

        public static final int FIELD_PRINT_DATE
        Specifies the PRINTDATE field.
      • FIELD_PRIVATE = 77

        public static final int FIELD_PRIVATE
        Specifies the PRIVATE field.
      • FIELD_QUOTE = 35

        public static final int FIELD_QUOTE
        Specifies the QUOTE field.
      • FIELD_REF = 3

        public static final int FIELD_REF
        Specifies the REF field.
      • 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
        Specifies the RD field.
      • FIELD_REVISION_NUM = 24

        public static final int FIELD_REVISION_NUM
        Specifies the REVNUM field.
      • FIELD_SAVE_DATE = 22

        public static final int FIELD_SAVE_DATE
        Specifies the SAVEDATE field.
      • FIELD_SECTION = 65

        public static final int FIELD_SECTION
        Specifies the SECTION field.
      • FIELD_SECTION_PAGES = 66

        public static final int FIELD_SECTION_PAGES
        Specifies the SECTIONPAGES field.
      • FIELD_SEQUENCE = 12

        public static final int FIELD_SEQUENCE
        Specifies the SEQ field.
      • FIELD_SET = 6

        public static final int FIELD_SET
        Specifies the SET field.
      • FIELD_SHAPE = 95

        public static final int FIELD_SHAPE
        Specifies the SHAPE field.
      • FIELD_SKIP_IF = 43

        public static final int FIELD_SKIP_IF
        Specifies the SKIPIF field.
      • FIELD_STYLE_REF = 10

        public static final int FIELD_STYLE_REF
        Specifies the STYLEREF field.
      • FIELD_SUBJECT = 16

        public static final int FIELD_SUBJECT
        Specifies the SUBJECT field.
      • FIELD_SYMBOL = 57

        public static final int FIELD_SYMBOL
        Specifies the SYMBOL field.
      • FIELD_TEMPLATE = 30

        public static final int FIELD_TEMPLATE
        Specifies the TEMPLATE field.
      • FIELD_TIME = 32

        public static final int FIELD_TIME
        Specifies the TIME field.
      • FIELD_TITLE = 15

        public static final int FIELD_TITLE
        Specifies the TITLE field.
      • FIELD_TOA = 73

        public static final int FIELD_TOA
        Specifies the TOA field.
      • FIELD_TOA_ENTRY = 74

        public static final int FIELD_TOA_ENTRY
        Specifies the TA field.
      • FIELD_TOC = 13

        public static final int FIELD_TOC
        Specifies the TOC field.
      • FIELD_TOC_ENTRY = 9

        public static final int FIELD_TOC_ENTRY
        Specifies the TC field.
      • FIELD_USER_ADDRESS = 62

        public static final int FIELD_USER_ADDRESS
        Specifies the USERADDRESS field.
      • FIELD_USER_INITIALS = 61

        public static final int FIELD_USER_INITIALS
        Specifies the USERINITIALS field.
      • FIELD_USER_NAME = 60

        public static final int FIELD_USER_NAME
        Specifies the USERNAME field.