Aspose::Words::Fields::FieldType enum

FieldType enum

Specifies Microsoft Word field types.

enum class FieldType

Values

NameValueDescription
FieldNone0Field type is not specified or unknown.
FieldCannotParse1Specifies that the field was unable to be parsed.
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.
FieldCitation1980Specifies the CITATION field.
FieldComments19Specifies the COMMENTS field.
FieldCompare80Specifies the COMPARE field.
FieldCreateDate21Specifies the CREATEDATE field.
FieldData40Specifies the DATA field.
FieldDatabase78Specifies the DATABASE field.
FieldDate31Specifies the DATE field.
FieldDDE45Specifies the DDE field.
FieldDisplayBarcode6301Specifies the DISPLAYBARCODE field.
FieldMergeBarcode6302Specifies the MERGEBARCODE field.
FieldDDEAuto46Specifies the DDEAUTO 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.
FieldGreetingLine94Specifies the GREETINGLINE field.
FieldGlossary47Specifies the GLOSSARY field.
FieldGoToButton50Specifies the GOTOBUTTON field.
FieldHtmlActiveX91Specifies the field that represents an HTML control.
FieldHyperlink88Specifies the HYPERLINK field.
FieldIf7Specifies the IF 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.
FieldImport55Specifies the IMPORT field.
FieldKeyword18Specifies the KEYWORDS field.
FieldLastSavedBy20Specifies the LASTSAVEDBY field.
FieldLink56Specifies the LINK field.
FieldListNum90Specifies the LISTNUM field.
FieldMacroButton51Specifies the MACROBUTTON field.
FieldMergeField59Specifies the MERGEFIELD field.
FieldMergeRec44Specifies the MERGEREC field.
FieldMergeSeq75Specifies the MERGESEQ field.
FieldNext41Specifies the NEXT field.
FieldNextIf42Specifies the NEXTIF field.
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.
FieldPage33Specifies the PAGE field.
FieldPageRef37Specifies the PAGEREF field.
FieldPrint48Specifies the PRINT field.
FieldPrintDate23Specifies the PRINTDATE field.
FieldPrivate77Specifies the PRIVATE field.
FieldQuote35Specifies the QUOTE field.
FieldRef3Specifies the REF field.
FieldRefNoKeyword2Specifies that the field represents a REF field where the keyword has been omitted.
FieldRefDoc11Specifies the RD field.
FieldRevisionNum24Specifies the REVNUM field.
FieldSaveDate22Specifies the SAVEDATE field.
FieldSection65Specifies the SECTION field.
FieldSectionPages66Specifies the SECTIONPAGES field.
FieldSequence12Specifies the SEQ field.
FieldSet6Specifies the SET field.
FieldShape95Specifies the SHAPE field.
FieldSkipIf43Specifies the SKIPIF field.
FieldStyleRef10Specifies the STYLEREF field.
FieldSubject16Specifies the SUBJECT field.
FieldSymbol57Specifies the SYMBOL field.
FieldTemplate30Specifies the TEMPLATE field.
FieldTime32Specifies the TIME field.
FieldTitle15Specifies the TITLE field.
FieldTOA73Specifies the TOA field.
FieldTOAEntry74Specifies the TA field.
FieldTOC13Specifies the TOC field.
FieldTOCEntry9Specifies the TC field.
FieldUserAddress62Specifies the USERADDRESS field.
FieldUserInitials61Specifies the USERINITIALS field.
FieldUserName60Specifies the USERNAME field.

Examples

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

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

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

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

// This overload of the InsertField method automatically updates inserted fields.
ASSERT_LE(System::Math::Abs((System::DateTime::Parse(field->get_Result()) - System::DateTime::get_Today()).get_Hours()), 24);

Shows how to work with a FieldStart node.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

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

SharedPtr<FieldChar> fieldStart = field->get_Start();

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

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

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

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

See Also