FieldType enumeration

FieldType enumeration

Specifies Microsoft Word field types.

Members

NameDescription
FIELD_NONEField type is not specified or unknown.
FIELD_CANNOT_PARSESpecifies that the field was unable to be parsed.
FIELD_ADDINSpecifies the ADDIN field.
FIELD_ADDRESS_BLOCKSpecifies the ADDRESSBLOCK field.
FIELD_ADVANCESpecifies the ADVANCE field.
FIELD_ASKSpecifies the ASK field.
FIELD_AUTHORSpecifies the AUTHOR field.
FIELD_AUTO_NUMSpecifies the AUTONUM field.
FIELD_AUTO_NUM_LEGALSpecifies the AUTONUMLGL field.
FIELD_AUTO_NUM_OUTLINESpecifies the AUTONUMOUT field.
FIELD_AUTO_TEXTSpecifies the AUTOTEXT field.
FIELD_AUTO_TEXT_LISTSpecifies the AUTOTEXTLIST field.
FIELD_BARCODESpecifies the BARCODE field.
FIELD_BIBLIOGRAPHYSpecifies the BIBLIOGRAPHY field.
FIELD_BIDI_OUTLINESpecifies the BIDIOUTLINE field.
FIELD_CITATIONSpecifies the CITATION field.
FIELD_COMMENTSSpecifies the COMMENTS field.
FIELD_COMPARESpecifies the COMPARE field.
FIELD_CREATE_DATESpecifies the CREATEDATE field.
FIELD_DATASpecifies the DATA field.
FIELD_DATABASESpecifies the DATABASE field.
FIELD_DATESpecifies the DATE field.
FIELD_DDESpecifies the DDE field.
FIELD_DISPLAY_BARCODESpecifies the DISPLAYBARCODE field.
FIELD_MERGE_BARCODESpecifies the MERGEBARCODE field.
FIELD_DDE_AUTOSpecifies the DDEAUTO field.
FIELD_DOC_PROPERTYSpecifies the DOCPROPERTY field.
FIELD_DOC_VARIABLESpecifies the DOCVARIABLE field.
FIELD_EDIT_TIMESpecifies the EDITTIME field.
FIELD_EMBEDSpecifies the EMBED field.
FIELD_EQUATIONSpecifies the EQ field.
FIELD_FILE_NAMESpecifies the FILENAME field.
FIELD_FILE_SIZESpecifies the FILESIZE field.
FIELD_FILL_INSpecifies the FILLIN field.
FIELD_FOOTNOTE_REFSpecifies the FOOTNOTEREF field.
FIELD_FORM_CHECK_BOXSpecifies the FORMCHECKBOX field.
FIELD_FORM_DROP_DOWNSpecifies the FORMDROPDOWN field.
FIELD_FORM_TEXT_INPUTSpecifies the FORMTEXT field.
FIELD_FORMULASpecifies the = (formula) field.
FIELD_GREETING_LINESpecifies the GREETINGLINE field.
FIELD_GLOSSARYSpecifies the GLOSSARY field.
FIELD_GO_TO_BUTTONSpecifies the GOTOBUTTON field.
FIELD_HTML_ACTIVE_XSpecifies the field that represents an HTML control.
FIELD_HYPERLINKSpecifies the HYPERLINK field.
FIELD_IFSpecifies the IF field.
FIELD_INCLUDESpecifies the INCLUDE field.
FIELD_INCLUDE_PICTURESpecifies the INCLUDEPICTURE field.
FIELD_INCLUDE_TEXTSpecifies the INCLUDETEXT field.
FIELD_INDEXSpecifies the INDEX field.
FIELD_INDEX_ENTRYSpecifies the XE field.
FIELD_INFOSpecifies the INFO field.
FIELD_IMPORTSpecifies the IMPORT field.
FIELD_KEYWORDSpecifies the KEYWORDS field.
FIELD_LAST_SAVED_BYSpecifies the LASTSAVEDBY field.
FIELD_LINKSpecifies the LINK field.
FIELD_LIST_NUMSpecifies the LISTNUM field.
FIELD_MACRO_BUTTONSpecifies the MACROBUTTON field.
FIELD_MERGE_FIELDSpecifies the MERGEFIELD field.
FIELD_MERGE_RECSpecifies the MERGEREC field.
FIELD_MERGE_SEQSpecifies the MERGESEQ field.
FIELD_NEXTSpecifies the NEXT field.
FIELD_NEXT_IFSpecifies the NEXTIF field.
FIELD_NOTE_REFSpecifies the NOTEREF field.
FIELD_NUM_CHARSSpecifies the NUMCHARS field.
FIELD_NUM_PAGESSpecifies the NUMPAGES field.
FIELD_NUM_WORDSSpecifies the NUMWORDS field.
FIELD_OCXSpecifies the OCX field.
FIELD_PAGESpecifies the PAGE field.
FIELD_PAGE_REFSpecifies the PAGEREF field.
FIELD_PRINTSpecifies the PRINT field.
FIELD_PRINT_DATESpecifies the PRINTDATE field.
FIELD_PRIVATESpecifies the PRIVATE field.
FIELD_QUOTESpecifies the QUOTE field.
FIELD_REFSpecifies the REF field.
FIELD_REF_NO_KEYWORDSpecifies that the field represents a REF field where the keyword has been omitted.
FIELD_REF_DOCSpecifies the RD field.
FIELD_REVISION_NUMSpecifies the REVNUM field.
FIELD_SAVE_DATESpecifies the SAVEDATE field.
FIELD_SECTIONSpecifies the SECTION field.
FIELD_SECTION_PAGESSpecifies the SECTIONPAGES field.
FIELD_SEQUENCESpecifies the SEQ field.
FIELD_SETSpecifies the SET field.
FIELD_SHAPESpecifies the SHAPE field.
FIELD_SKIP_IFSpecifies the SKIPIF field.
FIELD_STYLE_REFSpecifies the STYLEREF field.
FIELD_SUBJECTSpecifies the SUBJECT field.
FIELD_SYMBOLSpecifies the SYMBOL field.
FIELD_TEMPLATESpecifies the TEMPLATE field.
FIELD_TIMESpecifies the TIME field.
FIELD_TITLESpecifies the TITLE field.
FIELD_TOASpecifies the TOA field.
FIELD_TOA_ENTRYSpecifies the TA field.
FIELD_TOCSpecifies the TOC field.
FIELD_TOC_ENTRYSpecifies the TC field.
FIELD_USER_ADDRESSSpecifies the USERADDRESS field.
FIELD_USER_INITIALSSpecifies the USERINITIALS field.
FIELD_USER_NAMESpecifies the USERNAME field.

Examples

Shows how to insert a field into a document using a field code.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
field = builder.insert_field('DATE \\@ "dddd, MMMM dd, yyyy"')
self.assertEqual(aw.fields.FieldType.FIELD_DATE, field.type)
self.assertEqual('DATE \\@ "dddd, MMMM dd, yyyy"', field.get_field_code())
# This overload of the "insert_field" method automatically updates inserted fields.
self.assertAlmostEqual(datetime.strptime(field.result, '%A, %B %d, %Y'), datetime.now(), delta=timedelta(1))

Shows how to work with a FieldStart node.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
field = builder.insert_field(aw.fields.FieldType.FIELD_DATE, True).as_field_date()
field.format.date_time_format = 'dddd, MMMM dd, yyyy'
field.update()
field_start = field.start
self.assertEqual(aw.fields.FieldType.FIELD_DATE, field_start.field_type)
self.assertFalse(field_start.is_dirty)
self.assertFalse(field_start.is_locked)
# Retrieve the facade object which represents the field in the document.
field = field_start.get_field().as_field_date()
self.assertFalse(field.is_locked)
self.assertEqual(' DATE  \\@ "dddd, MMMM dd, yyyy"', field.get_field_code())
# Update the field to show the current date.
field.update()

See Also