Aspose::Words::Fields::FieldType enum

FieldType enum

Specifies Microsoft Word field types.

enum class FieldType : int

Values

NameValueDescription
FieldAddin81Specifies the ADDIN field.
FieldAddressBlock93Specifies the ADDRESSBLOCK field.
FieldAdvance84Specifies the ADVANCE field.
FieldAsk38Specifies the ASK field.
FieldAuthor17Specifies the AUTHOR field.
FieldAutoNum54Specifies the AUTONUM field.
FieldAutoNumLegal53Specifies the AUTONUMLGL field.
FieldAutoNumOutline52Specifies the AUTONUMOUT field.
FieldAutoText79Specifies the AUTOTEXT field.
FieldAutoTextList89Specifies the AUTOTEXTLIST field.
FieldBarcode63Specifies the BARCODE field.
FieldBibliography100500Specifies the BIBLIOGRAPHY field.
FieldBidiOutline92Specifies the BIDIOUTLINE field.
FieldCannotParse1Specifies that the field was unable to be parsed.
FieldCitation1980Specifies the CITATION field.
FieldComments19Specifies the COMMENTS field.
FieldCompare80Specifies the COMPARE field.
FieldCreateDate21Specifies the CREATEDATE field.
FieldDDE45Specifies the DDE field.
FieldDDEAuto46Specifies the DDEAUTO field.
FieldData40Specifies the DATA field.
FieldDatabase78Specifies the DATABASE field.
FieldDate31Specifies the DATE field.
FieldDisplayBarcode6301Specifies the DISPLAYBARCODE field.
FieldDocProperty85Specifies the DOCPROPERTY field.
FieldDocVariable64Specifies the DOCVARIABLE field.
FieldEditTime25Specifies the EDITTIME field.
FieldEmbed58Specifies the EMBED field.
FieldEquation49Specifies the EQ field.
FieldFileName29Specifies the FILENAME field.
FieldFileSize69Specifies the FILESIZE field.
FieldFillIn39Specifies the FILLIN field.
FieldFootnoteRef5Specifies the FOOTNOTEREF field.
FieldFormCheckBox71Specifies the FORMCHECKBOX field.
FieldFormDropDown83Specifies the FORMDROPDOWN field.
FieldFormTextInput70Specifies the FORMTEXT field.
FieldFormula34Specifies the = (formula) field.
FieldGlossary47Specifies the GLOSSARY field.
FieldGoToButton50Specifies the GOTOBUTTON field.
FieldGreetingLine94Specifies the GREETINGLINE field.
FieldHtmlActiveX91Specifies the field that represents an HTML control.
FieldHyperlink88Specifies the HYPERLINK field.
FieldIf7Specifies the IF field.
FieldImport55Specifies the IMPORT field.
FieldInclude36Specifies the INCLUDE field.
FieldIncludePicture67Specifies the INCLUDEPICTURE field.
FieldIncludeText68Specifies the INCLUDETEXT field.
FieldIndex8Specifies the INDEX field.
FieldIndexEntry4Specifies the XE field.
FieldInfo14Specifies the INFO field.
FieldKeyword18Specifies the KEYWORDS field.
FieldLastSavedBy20Specifies the LASTSAVEDBY field.
FieldLink56Specifies the LINK field.
FieldListNum90Specifies the LISTNUM field.
FieldMacroButton51Specifies the MACROBUTTON field.
FieldMergeBarcode6302Specifies the MERGEBARCODE field.
FieldMergeField59Specifies the MERGEFIELD field.
FieldMergeRec44Specifies the MERGEREC field.
FieldMergeSeq75Specifies the MERGESEQ field.
FieldNext41Specifies the NEXT field.
FieldNextIf42Specifies the NEXTIF field.
FieldNone0Field type is not specified or unknown.
FieldNoteRef72Specifies the NOTEREF field.
FieldNumChars28Specifies the NUMCHARS field.
FieldNumPages26Specifies the NUMPAGES field.
FieldNumWords27Specifies the NUMWORDS field.
FieldOcx87Specifies 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. | | FieldPage | 33 | Specifies the PAGE field. | | FieldPageRef | 37 | Specifies the PAGEREF field. | | FieldPrint | 48 | Specifies the PRINT field. | | FieldPrintDate | 23 | Specifies the PRINTDATE field. | | FieldPrivate | 77 | Specifies the PRIVATE field. | | FieldQuote | 35 | Specifies the QUOTE field. | | FieldRef | 3 | Specifies the REF field. | | FieldRefDoc | 11 | Specifies the RD field. | | FieldRefNoKeyword | 2 | Specifies that the field represents a REF field where the keyword has been omitted. | | FieldRevisionNum | 24 | Specifies the REVNUM field. | | FieldSaveDate | 22 | Specifies the SAVEDATE field. | | FieldSection | 65 | Specifies the SECTION field. | | FieldSectionPages | 66 | Specifies the SECTIONPAGES field. | | FieldSequence | 12 | Specifies the SEQ field. | | FieldSet | 6 | Specifies the SET field. | | FieldShape | 95 | Specifies the SHAPE field. | | FieldSkipIf | 43 | Specifies the SKIPIF field. | | FieldStyleRef | 10 | Specifies the STYLEREF field. | | FieldSubject | 16 | Specifies the SUBJECT field. | | FieldSymbol | 57 | Specifies the SYMBOL field. | | FieldTOA | 73 | Specifies the TOA field. | | FieldTOAEntry | 74 | Specifies the TA field. | | FieldTOC | 13 | Specifies the TOC field. | | FieldTOCEntry | 9 | Specifies the TC field. | | FieldTemplate | 30 | Specifies the TEMPLATE field. | | FieldTime | 32 | Specifies the TIME field. | | FieldTitle | 15 | Specifies the TITLE field. | | FieldUserAddress | 62 | Specifies the USERADDRESS field. | | FieldUserInitials | 61 | Specifies the USERINITIALS field. | | FieldUserName | 60 | Specifies the USERNAME field. |

Examples

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

auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);

System::SharedPtr<Aspose::Words::Fields::Field> field = builder->InsertField(u"DATE \\@ \"dddd, MMMM dd, yyyy\"");

ASSERT_EQ(field->get_Type(), FieldType::FieldDate);
ASSERT_EQ(field->GetFieldCode(), (u"DATE \\@ \"dddd, MMMM dd, yyyy\""));

// This overload of the InsertField method automatically updates inserted fields.
ASSERT_TRUE((System::DateTime::get_Today() - System::DateTime::Parse(field->get_Result())).get_Days() <= 1);

Shows how to work with a FieldStart node.

auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);

auto field = System::ExplicitCast<Aspose::Words::Fields::FieldDate>(builder->InsertField(FieldType::FieldDate, true));
field->get_Format()->set_DateTimeFormat(u"dddd, MMMM dd, yyyy");
field->Update();

System::SharedPtr<Aspose::Words::Fields::FieldChar> fieldStart = field->get_Start();

ASSERT_EQ(fieldStart->get_FieldType(), FieldType::FieldDate);
ASPOSE_ASSERT_EQ(fieldStart->get_IsDirty(), false);
ASPOSE_ASSERT_EQ(fieldStart->get_IsLocked(), false);

// Retrieve the facade object which represents the field in the document.
field = System::ExplicitCast<Aspose::Words::Fields::FieldDate>(fieldStart->GetField());

ASPOSE_ASSERT_EQ(field->get_IsLocked(), false);
ASSERT_EQ(field->GetFieldCode(), (u" DATE  \\@ \"dddd, MMMM dd, yyyy\""));

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

See Also