FieldType Enumeration |
Namespace: Aspose.Words.Fields
Member name | Value | Description | |
---|---|---|---|
FieldNone | 0 | Field type is not specified or unknown. | |
FieldCannotParse | 1 | Specifies that the field was unable to be parsed. | |
FieldAddin | 81 | Specifies the ADDIN field. | |
FieldAddressBlock | 93 | Specifies the ADDRESSBLOCK field. | |
FieldAdvance | 84 | Specifies the ADVANCE field. | |
FieldAsk | 38 | Specifies the ASK field. | |
FieldAuthor | 17 | Specifies the AUTHOR field. | |
FieldAutoNum | 54 | Specifies the AUTONUM field. | |
FieldAutoNumLegal | 53 | Specifies the AUTONUMLGL field. | |
FieldAutoNumOutline | 52 | Specifies the AUTONUMOUT field. | |
FieldAutoText | 79 | Specifies the AUTOTEXT field. | |
FieldAutoTextList | 89 | Specifies the AUTOTEXTLIST field. | |
FieldBarcode | 63 | Specifies the BARCODE field. | |
FieldBibliography | 100500 | Specifies the BIBLIOGRAPHY field. | |
FieldBidiOutline | 92 | Specifies the BIDIOUTLINE field. | |
FieldCitation | 1980 | Specifies the CITATION field. | |
FieldComments | 19 | Specifies the COMMENTS field. | |
FieldCompare | 80 | Specifies the COMPARE field. | |
FieldCreateDate | 21 | Specifies the CREATEDATE field. | |
FieldData | 40 | Specifies the DATA field. | |
FieldDatabase | 78 | Specifies the DATABASE field. | |
FieldDate | 31 | Specifies the DATE field. | |
FieldDDE | 45 | Specifies the DDE field. | |
FieldDisplayBarcode | 6301 | Specifies the DISPLAYBARCODE field. | |
FieldMergeBarcode | 6302 | Specifies the MERGEBARCODE field. | |
FieldDDEAuto | 46 | Specifies the DDEAUTO field. | |
FieldDocProperty | 85 | Specifies the DOCPROPERTY field. | |
FieldDocVariable | 64 | Specifies the DOCVARIABLE field. | |
FieldEditTime | 25 | Specifies the EDITTIME field. | |
FieldEmbed | 58 | Specifies the EMBED field. | |
FieldEquation | 49 | Specifies the EQ field. | |
FieldFileName | 29 | Specifies the FILENAME field. | |
FieldFileSize | 69 | Specifies the FILESIZE field. | |
FieldFillIn | 39 | Specifies the FILLIN field. | |
FieldFootnoteRef | 5 | Specifies the FOOTNOTEREF field. | |
FieldFormCheckBox | 71 | Specifies the FORMCHECKBOX field. | |
FieldFormDropDown | 83 | Specifies the FORMDROPDOWN field. | |
FieldFormTextInput | 70 | Specifies the FORMTEXT field. | |
FieldFormula | 34 | Specifies the = (formula) field. | |
FieldGreetingLine | 94 | Specifies the GREETINGLINE field. | |
FieldGlossary | 47 | Specifies the GLOSSARY field. | |
FieldGoToButton | 50 | Specifies the GOTOBUTTON field. | |
FieldHtmlActiveX | 91 | Specifies the field that represents an HTML control. | |
FieldHyperlink | 88 | Specifies the HYPERLINK field. | |
FieldIf | 7 | Specifies the IF field. | |
FieldInclude | 36 | Specifies the INCLUDE field. | |
FieldIncludePicture | 67 | Specifies the INCLUDEPICTURE field. | |
FieldIncludeText | 68 | Specifies the INCLUDETEXT field. | |
FieldIndex | 8 | Specifies the INDEX field. | |
FieldIndexEntry | 4 | Specifies the XE field. | |
FieldInfo | 14 | Specifies the INFO field. | |
FieldImport | 55 | Specifies the IMPORT field. | |
FieldKeyword | 18 | Specifies the KEYWORDS field. | |
FieldLastSavedBy | 20 | Specifies the LASTSAVEDBY field. | |
FieldLink | 56 | Specifies the LINK field. | |
FieldListNum | 90 | Specifies the LISTNUM field. | |
FieldMacroButton | 51 | Specifies the MACROBUTTON field. | |
FieldMergeField | 59 | Specifies the MERGEFIELD field. | |
FieldMergeRec | 44 | Specifies the MERGEREC field. | |
FieldMergeSeq | 75 | Specifies the MERGESEQ field. | |
FieldNext | 41 | Specifies the NEXT field. | |
FieldNextIf | 42 | Specifies the NEXTIF field. | |
FieldNoteRef | 72 | Specifies the NOTEREF field. | |
FieldNumChars | 28 | Specifies the NUMCHARS field. | |
FieldNumPages | 26 | Specifies the NUMPAGES field. | |
FieldNumWords | 27 | Specifies the NUMWORDS field. | |
FieldOcx | 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. | |
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. | |
FieldRefNoKeyword | 2 | Specifies that the field represents a REF field where the keyword has been omitted. | |
FieldRefDoc | 11 | Specifies the RD field. | |
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. | |
FieldTemplate | 30 | Specifies the TEMPLATE field. | |
FieldTime | 32 | Specifies the TIME field. | |
FieldTitle | 15 | Specifies the TITLE 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. | |
FieldUserAddress | 62 | Specifies the USERADDRESS field. | |
FieldUserInitials | 61 | Specifies the USERINITIALS field. | |
FieldUserName | 60 | Specifies the USERNAME field. |
Document doc = new Document(MyDir + "Table of contents.docx"); FieldChar fieldStart = (FieldChar)doc.GetChild(NodeType.FieldStart, 0, true); Assert.AreEqual(FieldType.FieldTOC, fieldStart.FieldType); Assert.AreEqual(false, fieldStart.IsDirty); Assert.AreEqual(false, fieldStart.IsLocked); // Retrieve the facade object which represents the field in the document Field field = fieldStart.GetField(); Assert.AreEqual(false, field.IsLocked); Assert.AreEqual(" TOC \\o \"1-3\" \\h \\z \\u ", field.GetFieldCode()); // This updates only this field in the document. field.Update();
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 Console.WriteLine("FieldResult: {0}", dateField.Result); // Display the field code which defines the behavior of the field. This can been seen in Microsoft Word by pressing ALT+F9 Console.WriteLine("FieldCode: {0}", dateField.GetFieldCode()); // The field type defines what type of field in the Document this is. In this case the type is "FieldDate" Console.WriteLine("FieldType: {0}", dateField.Type); // 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();