Current location - Education and Training Encyclopedia - Graduation thesis - How to set the domain code in word?
How to set the domain code in word?
First, the field application foundation

1. What is a domain?

Simply put, a field is a set of codes that instruct Word to automatically insert text, graphics, page numbers or other information into a document. Each field has a unique name, and its function is very similar to that in Excel. Let's take Seq and Date fields as examples to explain some basic concepts about fields.

The relationship in the form of "{seq identifier [bookmark] [switches]}" is called "domain code" in Word. It consists of the following parts:

Domain characteristic character: that is, the brace "{}" containing the domain code, but you can't enter it directly with the keyboard, but press Ctrl+F9 to enter the domain characteristic character.

Domain name: the "Seq" in the above formula is called "Seq domain", and Word 2003 provides 9 categories ***74 domains.

Domain Commands and Switches: Commands or switches that set domain operations. For example, the "identifier" and "bookmark" in the above formula, the former is the name specified for a series of items to be numbered, and the latter can add bookmarks to refer to items elsewhere in the document. Switches are called optional switches, and domains usually have one or more optional switches separated by spaces.

Field result: the display result of the field, similar to the value obtained after the operation of Excel function. For example, if you enter the domain code "{date \ @" yyyymm DD "\ * mergeformat}" in the document, the domain result is the current system date.

The domain can automatically complete tasks without manual intervention, such as arranging document pages and counting the total number of pages; Insert date and time in different formats and update; Insert other documents into the active document through links and references; Automatic catalogue, keyword index and chart catalogue; Realize automatic mail merge printing; Create standard format music scores, add pinyin to Chinese characters and so on.

2. Insert a field in the document.

(1) Use the command to insert a domain.

In Word, it is difficult to manually control advanced complex field functions, such as automatic numbering and mail merge, caption, cross-reference, index and table of contents. For the convenience of users, most of the 74 domains in 9 categories are provided by commands.

There is a field command in the Insert menu, which is suitable for ordinary users. All fields provided by Word can be inserted in this way. You just need to put the cursor where you want to insert the domain, and click the "Insert → Domain" menu command to open the domain dialog box.

First, select the category of the field to be inserted in the category drop-down list, such as numbers, equations and formulas. After selecting the category of the required domain name, the domain name list box will display the names of all domain names in this category. Select the domain name to be inserted (such as "AutoNum"), and the description box will display "Insert Auto Number", from which we can know the function of this domain. For the AutoNum field, you only need to select the format you need in the Format list, and click OK to insert the auto number with a specific format into the page. As shown in figure 1.

You can also select the entered domain code, click the right mouse button, and then select the command "Update Domain", "Edit Domain" or "Switch Domain Code" to operate the domain.

(2) use the keyboard to insert

If you are familiar with the domain code, or need to quote the domain code designed by others, it will be faster to enter it directly with the keyboard. The operation method is: place the cursor at the position where the domain needs to be inserted, and press Ctrl+F9 to insert the domain characteristic character "{}". Then move the cursor to the middle of the domain feature code and enter the domain type, domain instruction, switch, etc. In order from left to right. When finished, press F9 on the keyboard to update the field, or press Shift+F9 to display the field results.

If the displayed domain result is incorrect, you can press Shift+F9 again to switch to the state of displaying the domain code, and modify the domain code again until the displayed domain result is correct.

(3) Insert with function command

Because there are many domain instructions and switches in many domains, it is difficult to control and use the above two methods. Therefore, Word 2003 integrates some commonly used functions into the system in the form of commands, such as "Pinyin Guide", "Vertical and Horizontal Mixed Arrangement" and "Circle Text". Users can use them just like ordinary Word commands.

3. Domain management

Quickly delete a domain name

After the field inserted into the document is updated, its style is the same as that of normal text. If you plan to delete some or all fields, it will be difficult to find them (especially after hiding the edit tag). Press Alt+F9 to display all the field codes in the document (press Alt+F9 repeatedly to switch between displaying and updating the field codes), then click Edit → Find menu command, click Advanced button in the dialog box that appears, stop the cursor in the Find Content box, click Special Character button and select a field from the list (p Enter, click Find Next button to find the field in the document, select it after finding it, and then press Delete key to delete it.

(2) Modify the domain

Modifying a domain is the same as editing a domain. If you are not satisfied with the result of the domain, you can directly edit the domain code to change the domain result. Press Alt+F9 (valid for the whole document) or Shift+F9 (valid for the selected field) to switch between displaying field codes or displaying field results. When switching to display the domain code, you can edit it directly, and then press Shift+F9 to view the domain results.

(3) cancel the domain coloring

By default, the selected field (or field code) in a Word document is displayed with a gray shading, but this gray shading will not be printed when printing. If you don't want to see this effect, you can click the Tools → Options menu command, click the View tab in the dialog box that appears, and then select the Don't Show option from the field shading drop-down list.

(4) Locking and unlocking domains

If you don't want to update the results of the current domain, you can lock it. The specific operation method is: click the field with the mouse, and then press Ctrl+F 1 1. If you want to unlock a domain, you can update it. Just click the field and press Ctrl+Shift+F 1 1.

(5) Unlink the domain name.

If a domain does not need to be updated after inserting a document, you can unlink the domain and replace the domain code with the domain result. You just need to select the field to unlink, and then press Ctrl+Shift+F9.

Secondly, take a quick look at the field.

1. Numbers

(1) autonomous domain

Syntax: {AUTONUM}

Objective: Number the paragraphs in sequence.

Options:

Switch Description: \s Defines the delimiter.

(2) Autonomous domain

Syntax: {AUTONUMLGL [Switches]}

Objective: To automatically number the paragraphs of legal and technical publications.

Options:

Meaning of the switch: \e Displays legal numbers without periods.

(3) Autonomous domain

Syntax: {AUTONUMOUT}

Objective: To automatically number paragraphs in outline style.

(4) Bar code domain

Syntax: {BARCODE \u "LiteralText "or Bookmark \b [Switches]}

Objective: To insert postal bar code (machine-readable address format used by the US Postal Service). POSTNET (the recipient clicks on the bar code) or "appearance identification mark" (or FIM) can be inserted.

Options:

Explain the meaning:

The address and postal code of the recipient of the "text" or bookmark. Bookmarks can replace LiteralText when followed by the \b switch. In addition, LiteralText can also be the result of nested fields.

Switch description:

\b When in front of the bookmark, use the postal code information in the address defined by the bookmark.

\f "Letter" is inserted into "Appearance Identification Mark" (FIM), and the type of reply mark is specified by the letter: "A" is inserted with polite reply mark; "C" inserts the business reply mark. To print FIM-A and FIM-C marks, you must have a POSTNET barcode.

\u indicates that the barcode is the postal address of the United States.

(5) Bookmarks and reference fields

Syntax: {[REF] Bookmark [Switches]}

Usage: Inserts the text or graphics represented by the specified bookmark, and the bookmark must be defined in the active document. To insert bookmarked text or graphics in other documents, you can use INCL? Picture or INCL text field.

Options:

Explain the meaning:

Bookmark signature If the bookmarked text contains a paragraph tag, the text before the bookmark field will use the format of the paragraph in the bookmark.

Switch description:

\f Increase the number of footnotes, endnotes or comments marked by bookmarks, and insert corresponding comments or comment text.

\h Create a hyperlink to a bookmark paragraph.

\n This field will display the full paragraph number of the cross-referenced paragraph without subsequent periods.

\p Makes the field display its position relative to the source bookmark in the form of "See Above" or "See Below".

\ rInserts the full paragraph number of the bookmarked paragraph in the related text or relative to the position in the numbering scheme, without subsequent periods.

\ tWhen used with the \n, \r, or \w switches, causes the REF field to mask non-delimited or non-numeric text.

\w Inserts the paragraph number of the bookmark paragraph, which reflects the position of the paragraph in the whole document context.

(6)ListNum domain

Syntax: {LISTNUM "Name" [Switches]}

Objective: To insert a set of numbers anywhere in a paragraph.

Options:

Instruction interpretation

Name associates the LISTNUM field with the specified list.

Switch description

\l Specifies the level in the list, ignoring the default operation of the domain.

\s Specify the initial value of this field. Please use an integer value.

(7) Page domain

Syntax: {PAGE [\* format switch]}

Objective: To insert the page number where the page field is located.

Options:

Switch description

\*FormatSwitch optional switch to replace the number style selected in the Number Format box of the Page Number Format dialog box. To change the character format of page numbers, you can modify the character style in the Number Format box.

(8)RevNum domain

Syntax: {REVNUM}

Usage: Inserts the revision time of the document from the Statistics tab in the Properties dialog box of the File menu.

(9) Nodes

Grammar: {SECTION}

Purpose: Insert the number of the current section.

(10)SectionPages domain

Grammar: {SECTIONPAGES}

Objective: To insert the total number of pages in a section. When using this field, the page numbers of each section after the first section must be renumbered from 1.

(1 1) sequence domain

Syntax: {seq identifier[ bookmark] [switch]}

Purpose: Number the chapters, tables, charts and other items in the document in sequence.

Options:

Switch description

\c Repeat the last serial number.

\h Hide domain results

\ nInserts the next serial number of the specified item.

\ r Resets the serial number to the specified value n

\s Resets the serial number of the title level after "s"

2. Equations and formulas

(1) advanced domain

Syntax: {Advanced [switch]}

Usage: Offset the starting point of the text behind the forward field up, down, left, right or the specified horizontal or vertical position.

Options:

Switch description

\d Move down by the specified number of points.

\u Move up by the specified number of points.

\l Moves the specified number of points to the left.

\r Moves the specified number of points to the right.

\x Specifies the distance from the left border of a column, frame or text box.

\y Moves to the specified vertical position relative to the current line.

(2) EQ field

Syntax: {EQ switch}

Objective: To generate mathematical formula.

Options:

Switch description

Array switch: \a () Draw a two-dimensional array.

Parentheses: \b () Encloses a single element in parentheses.

Displacement: \d () Moves the next character to the left or right by the specified number of points.

Score: \f (,) Create a score.

Fraction: \i (,,) creates an integer using the specified symbol or default symbol and three elements.

List: \l () Combines multiple values into a list that can be used as a single element.

Overlap: \o () Prints each subsequent element above the previous one.

Root number: \r (,) Use one or two elements to draw the root number.

Superscript or Subscript: \s () sets the subscript.

Box: \x () Draw a border around the element.

(3) Symbol field

Syntax: {SYMBOL CharNum [Switches]}

Usage: Inserts a single character or string into the ANSI character set.

Options:

Instruction description

The character corresponding to the ANSI code, or its decimal or hexadecimal value. Hexadecimal values must be in the form of 0xn, that is, 0x (zero followed by the letter X) is added before hexadecimal value n..

Switch description

\f Font Name is the font used to insert characters. Font names must be enclosed in quotation marks. Without this switch, the characters will use the font used by the symbol field code.

\h Inserts symbols without affecting the line spacing of paragraphs. When using this switch to insert a large symbol, the text on the top of the symbol may be overwritten.

\s point Specifies the ruler of the font in points.

\u Specifies that the character is Unicode.

3. Links and references

(1) AutoText Collection Domain

Syntax: {AutoText AutoText Entry}

Objective: To insert the specified AutoText entry.

Options:

Instruction meaning

AutoTextEntry needs to insert the AutoText entry of the document.

(2) AutoText list field

Syntax: {AutoText list "text" \ s[ style name] \ t ["prompt text"]}

Objective: To create a drop-down list of AutoText entries in the active template. The list varies with the style applied to AutoText entries.

Options:

Instruction meaning

"LiteralText" is the text displayed in the document before the user displays the drop-down menu.

Style Name Displays the style name used by AutoText entries in the list. It can be paragraph style or character style.

"TipText" is the text displayed in the screen tip when the mouse pointer rests on the field result.

Switch description

\s Specifies that the list contains entries based on a specific style. Without this switch, AutoText entries with the current paragraph style will be displayed. If there is no corresponding entry in the current style, all AutoText entries will be displayed.

\ tSpecify specific text to be displayed in the screentip instead of the default prompt text.

(3) Hyperlink domain

Syntax: {hyperlink "filename "[ switch]}

Purpose: Insert a hyperlink with prompt text, from which you can jump to other locations.

Options:

Instruction meaning

The location of the target to which the File Name will jump. If it contains a long file name with spaces, enclose it in quotation marks and specify the path with double backslashes instead of single backslashes.

Switch description

\l Specify the location in the file to which the hyperlink jumps.

\m Add the coordinates of the hyperlink for the server-side image map.

\ nOpen the target location information in a new window.

\o Specifies the screentip text for the hyperlink.

\s specifies a jump location, but this location is unnamed. This switch appears for hyperlinks created by dragging information.

\t Specify the destination to redirect the link to. Use this switch to create a link from a framed web page to a web page to be displayed outside the frame.

(4) including? Image domain

Syntax: {INCL? Picture File Name [Switch]}

Purpose: Insert the specified graphic.

Options:

Instruction meaning

The name and location of the File Name graphic file.

\c The converter identifies the required graphics filter.

\d The graphic data is not saved with the document to reduce the file length.

(5) including? Text field

Syntax: {INCL? Text "file name" [bookmark] [switch]}

Usage: Insert the text and graphics contained in the named document. Note: You can insert the whole document; If it is a Word document, you can insert only the part referenced by the bookmark.

Options:

Instruction meaning

The name and location of the File Name document.

Bookmark Bookmark refers to the part to be included in the file.

Switch description

\c class name

\! Word prohibits updating fields inserted into text unless the fields are updated in the source document first.

(6) Link domain

Syntax: {link class name "filename" [place reference] [switches]}

Usage: Link information copied from other applications to source files through OLE.

Options:

Instruction meaning

Application type of link information.

The name and location of the file name source file.

PlaceReference identifies the linked part of the source file.

Switch description

\a Automatically update the linked fields, or delete this switch to use manual update.

\b The linked object is inserted as a bitmap.

\d The graphic data is not saved with the document to reduce the file length.

\h Insert the linked object in HTML text format.

\p Linked objects are inserted as pictures.

\r Inserts a linked object in RTF format.

\ tInserts the linked object in plain text format.

(7)NoteRef domain

Syntax: {NOTEREF bookmark [switch]}

Usage: Insert the footnote or endnote reference mark of bookmark mark, so as to refer to the same comment multiple times or cross-reference the footnote or endnote.

Options:

Instruction meaning

Bookmarks refer to the signatures of books marked by footnotes or endnotes. Bookmarks must refer to reference tags in the body of the document, not tags in footnote or endnote windows. If there is no bookmark, you must create one.

Switch description

\f Inserts the reference mark and the same character format as the footnote reference style or endnote reference style.

\h Insert a hyperlink to the bookmark footnote.

\p Insert the relative position of the footnote or endnote. If there is a NOTEREF field before the bookmark in the document, its value is "See below". If there is a NOTEREF field after the bookmark, its value is "See above". If the NOTEREF field is in the bookmark, an error is returned.

(8)PageRef domain

Syntax: {pageref bookmark [\ * format switch]}

Usage: Insert the page number of bookmark as a cross reference.

Options:

Switch description

\* Format Switch optional switch to replace the number style selected in the Number Format box of the Page Number Format dialog box.

\h Create a hyperlink to the bookmark paragraph.

\p Makes the field display its position relative to the source bookmark. When the PAGEREF field is not on the current page, use the string "on page #". When the PAGEREF field is on the current page, omit "On Page #" and only return "See above" or "See below".

(9) Quotation field

Syntax: {QUOTE "LiteralText"}

Usage: Inserts the specified text into the document.

Options:

Instruction description

"LiteralText" inserts the text of the document. These words must be enclosed in quotation marks. And can contain any other fields except AUTONUM, AUTONUMLGL, AUTONUMOUT or SYMBOL.

(10)Ref domain

Syntax: {[REF] Bookmark [Switches]}

Usage: Insert the specified bookmark.

Options:

Conversion purpose

\f Increase the number of footnotes, endnotes or comments marked by bookmarks, and insert corresponding comments or comment text.

\h Create a hyperlink to the bookmark paragraph.

\ nCauses this field to display the full paragraph number of the referenced paragraph, without a period. Word does not display information from previous levels unless it is included in the current level.

\p Use See Above or See Below to display the position of the field relative to the source bookmark.

\ rInserts the full paragraph number of the bookmarked paragraph in the related text or relative to the position in the numbering scheme, without subsequent periods.

\ tWhen used with the \n, \r, or \w switches, causes the REF field to mask non-delimited or non-numeric text.

\w Inserts a bookmarked paragraph number that reflects the position of the paragraph in the overall context of the document.

(1 1)StyleRef domain

Syntax: {styleref styleidentifier [switches]}

Usage: Insert the text in the specified style. If you insert the STYLEREF field into the header or footer, the first or last text with the specified style settings on the current page will be printed.

Options:

academic goal

StyleIdentifier has the style name of the text to be inserted. This style can be a paragraph style or a character style. If the style name contains spaces, enclose it in quotation marks.

Switch description

\l Inserts the last paragraph with the specified style on the current page instead of the first paragraph with that style. Word searches the current page for this style from bottom to top, not from top to bottom (by default, it is from top to bottom).

\ nCauses this field to display the full paragraph number of the quoted paragraph without a period. Word does not display information from previous levels unless it is included in the current level.

\p Use See Above or See Below to display the position of the field relative to the source bookmark.

\r Inserts the complete paragraph number in the relevant context (that is, arranges the relevant context according to the paragraph number) without a period.

\ tWhen used with switches such as \n, \r or \w, instructs the STYLEREF field to delete non-delimited or non-numeric text.

\w Inserts the full paragraph number of the bookmarked paragraph in the entire context.

4. Date and time

(1) Create Date Field

Syntax: {Creation Date [\ @ "Date and Time Picture"]}

Objective: To insert the date and time when the document was first saved under the current name.

Options:

Explanation: \ @ "Date and Time Picture" specifies the date and time format, replacing the default format.

(2) Date field

Syntax: {date [\ @ "date and time picture"] [switch]}

Usage: Insert the current date.

Options:

Switch description

\l Inserts a date in the format selected in the Date and Time dialog box on the Insert menu last time.

\ @ Date Time Picture specifies a date format, which will override the default format.

(3) Edit the time domain

Syntax: {EDITTIME}

Usage: Insert the editor-in-chief time after the document is created, in minutes. It is consistent with the time in the statistics tab of the properties dialog box in the file menu.

(4) Print date field

Syntax: {Print date \ @ "date and time picture"}

Purpose: Insert the date when the document was last printed.

Options:

Guidance and explanation

\ @ "Date Time Picture" specifies a date format different from the default format.

(5) Save the date field

Syntax: {savedate [\ @ "date and time picture"]}

Usage: Use the information in the Statistics tab of the Properties dialog box in the File menu to insert the date and time when the document was last saved (please refer to the item "Revision Time").

Options:

Description: \ @ "Date Time Picture" specifies a format different from the default format.

(6) Time domain

Syntax: {TIME [\@ "date and time picture"]}

Usage: Insert the current time.

Options:

Description meaning: \ @ "Date-Time Picture" specifies a time format different from the default setting.

5. Indexes and Contents

(1) index field

Syntax: {INDEX [Switches]}

Objective: To create and insert indexes.

Options:

Switch description

\b Bookmarks index the part of the document marked by the specified bookmark.

\c Column creates a multi-column index on one page.

\d "separator "when used with the \s switch, specifies the separator (up to five characters) between the serial number and the page number.

\e Delimiter specifies the delimiter (up to five characters) between the index item and the page number.

\f Identifiers only use the specified type of index items to build an index.

\g "Delimiter" specifies a delimiter (up to five characters) used to represent the page range.

\h Title Inserts text in the style of Index Title between groups of index items arranged alphabetically in the index.

\l "Delimiter "specifies the delimiter between multiple page references.

\p "Range "generates an index based on the specified letters.

\r Place the secondary index entry on the same line as the primary index entry.

\s If it is followed by a serial number, please add the serial number to the page number.

(2) R&D field

Syntax: {RD "FileName"}

Usage: Used to identify the files to be included when creating a table of contents, a table of quotations or an index based on TOC, TOA or index fields.

Options:

Instruction description

File Name The file to be added when creating a table of contents, a table of quotations or an index. If the path contains a long file name with spaces, please enclose it in quotation marks. When specifying a path, use a double backslash instead of a single backslash.

(3)TA domain

Syntax: {TA [Switches]}

Objective: To define the text and page number of the citation catalogue.

Options:

Switch description

\b Format the page number of the directory entry in bold.

\c Category specifies the category of the catalog item, which is a number corresponding to the category order in the Category box in the Label Reference dialog box. This number determines how citations are grouped in the citation catalogue.

\i Display page numbers of directory entries in italics.

\ l "long" defines the long citation of the directory entry in the citation directory.

\r Inserts a bookmark by using the page number range of the page marked by the specified bookmark as the page number of the directory entry.

\s "Short "defines the abbreviated form of a directory entry.

(4)TC domain

Syntax: {TC "Text" [Switches]}

Objective: To define the text and page numbers of items displayed in tables, tables, charts and other similar items.

Options:

Instruction meaning

"Text" is the text of the directory entry.

Switch description

\f Categories collect categories of directory items in a specific directory list. Unique "type" identifiers (usually A-Z) can be used to identify different types of list items.

\ l The project level of TC project. For example, the field {TC "Input Data \l 4} marks the level of the item as 4, so Word applies the built-in style" TOC4 "to the items in the table of contents. If no level is specified, the level 1 is used.

(5)TOA domain

Syntax: {TOA[ switch]}

Purpose: To generate and insert a quotation.

Options:

Switch description

Category specifies the category of catalog items to be collected in the table of authorities.

\b Bookmark collects directory entries only from the document part marked by the specified bookmark.

\e "Delimiter" specifies the characters (up to five) that separate directory entries and their page numbers.

\f Unformats the table of contents entries of documents in the table of authorities.

\g Delimiter specifies the characters (up to five) that separate the page range.

\h Includes the category title of the citation catalog entry.

\l Specify characters (up to five) to separate multi-page references.

\p Replace five or more page references pointing to the same citation with "Everywhere".

\s Identifier contains a number before the page number, such as case number or chapter number.

\d "Separator "is used with the \s switch to specify the characters (up to five) that separate the serial number from the page number.

(6)TOC domain

Syntax: {TOC [Switches]}

Objective: To create a directory.

Options:

Switching action

\ Identifiers list items that are captioned with the Title command on the Insert menu, but omit the title label and number.

\b Book signature only collects the catalog items in the document parts marked with the specified bookmarks.

The "SEQ Identifier" lists tables, charts or other items numbered with SEQ fields.

\f The project identifier establishes a directory based on the TC domain.

\h Hyperlink Inserts a directory entry as a hyperlink.

\ The directory established at the L level contains only TC domains designated as a specific level.

\n Level omits the page numbers in the table of contents.

\o Heading creates a table of contents based on paragraphs with built-in heading styles.

\p "Delimiter "specifies the delimiter between the directory entry and the page number.

\s Identifiers are preceded by numbers, such as chapter numbers. Chapters or other items must be numbered with the SEQ field.

\d "separator "when used with the \s switch, specifies the character used to separate the serial number from the page number.

\t "style, level,

Style, horizontal, ... "Create a table of contents based on paragraphs with styles different from the built-in heading styles.

\w Keep tab entries in the table of contents.

\x Keep line breaks in the directory.

\z Hide tabs and page numbers in Web layout view.

(7)XE domain

Syntax: {XE "Text" [Switches]}

Objective: To define the text and page number of index items.

Options:

Guidance and explanation

Text The text to display in the index. To indicate secondary index entries, you need to add primary index entry text and secondary index entry text, and separate them with a colon (:).

Switch description

\b Set the page number of this index item in bold format.

\f Type defines the index entry type.

\ I set the page number of the index entry to italic.

\r Bookmark inserts the page number of the page range marked by the specified bookmark as the page number of the index item.

\t "Text "Inserts text instead of page numbers.