java.lang.Object
com.aspose.words.FieldType
public class FieldType
- extends java.lang.Object
Utility class containing constants.
Specifies Microsoft Word field types.
Example:
Demonstrates how to retrieve the field class from an existing FieldStart node in the document.
Document doc = new Document(getMyDir() + "Table of contents.docx");
FieldChar fieldStart = (FieldChar) doc.getChild(NodeType.FIELD_START, 0, true);
Assert.assertEquals(fieldStart.getFieldType(), FieldType.FIELD_TOC);
Assert.assertEquals(fieldStart.isDirty(), false);
Assert.assertEquals(fieldStart.isLocked(), false);
// Retrieve the facade object which represents the field in the document
Field field = fieldStart.getField();
Assert.assertEquals(field.isLocked(), false);
Assert.assertEquals(field.getFieldCode(), " TOC \\o \"1-3\" \\h \\z \\u ");
// This updates only this field in the document
field.update();
Example:
Inserts a field into a document using DocumentBuilder and FieldCode.
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 behavior 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_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.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.