Create a Dictionary-Style Page Header, Styles

Have you ever imagined or tried to create a dictionary-style page header? How about a bible-style page header? If you have ever seen the pages of the bible, "New World Translation of the Holy Scriptures", you will know what kind of complex bible-style page header I am talking about.
Fig: Dictionary-style header


A dictionary-style page header is the type in which the first and last items that appear on a page are displayed and printed at the top of each page. In a typical dictionary, you'll usually find a copy of the first word/entry/item being defined on the page appearing in the header area at the top left of the page, and the last word/entry/item also appearing at the top right corner of the page. A dictionary-style page header is not limited in use to only dictionaries. It is widely used in documents such as bibles, membership directories, glossaries, etc. The STYLEREF field provides the field codes that help in creating a dictionary-style header in Word. It is used in conjunction with the style applied to the items on a page. The syntax is { STYLEREF StyleIdentifier [Switches ] }. A style is a set or combination of formatting commands, such as font, font size, font color, alignment, indentation, etc, that you store as a group with a unique name. When you apply a style, the whole group of formatting commands in that style are applied in one step.

Check out the following sidebar for instructions about creating a new style in Word
Skip sidebar. I know how to create a new style.


Word provides a set of built-in styles for all documents. Each template consists of a set of built-in styles that are applied to documents based on that template. When you start typing in a new document, Word applies the Normal style to each paragraph. The formatting characteristics combined into the Normal style are: Black (Automatic) 12-point Times New Roman font, single line spacing, and left text alignment. You can create four different types of styles in Word, and these are Character style, Paragraph style, Table style, and List style. You can use text that you've already formatted as the basis of a list style, paragraph style, or character style, by selecting it, and then building the new style on the formatting and other properties applied to the selected text.
.
How to Create a New Character Style
  1. On the Format menu, click Styles and Formatting.
    Alternatively, click the Styles and Formatting icon, located at the extreme left of the Formatting toolbar.
    The Styles and Formatting task pane is open.
  2. In the Styles and Formatting task pane, click New Style.
    The New Style dialog box is displayed.
  3. In the Name box, type a name for the style, e.g My Style.
  4. In the Style type box, click Character
  5. Under Formatting, select the formatting options -such as font, size, bold, italic, underline, and color - you want. 
    • To add more formatting options such as underline style, underline color, shadow, small caps, etc; character spacing settings, or text effects, click the Format button, click Font, select the options you want, and then click OK
    • If you want the style you are creating to be available for new documents, click the Add to template check box.
  6. Click OK to return to the document.
    The style name of the new character style you have created is added to the list of styles in the Styles and Formatting task pane.
Fig: Styles and Formatting task pane

Fig: New Style dialog box, showing character style options.



How to Create a New Paragraph Style
  1. On the Format menu, click Styles and Formatting.
    The Styles and Formatting task pane is open.
  2. In the Styles and Formatting task pane, click New Style.
    The New Style dialog box is displayed.
  3.  In the Name box, type a name for the style, e.g My Paragraph Style.
  4. In the Style type box, click Paragraph.
  5. Under Formatting, select the formatting options -such as font, size, font style, alignment, line spacing, paragraph spacing, and indents. - you want.
    • To add more formatting options such as Tabs, Borders and shading, Numbering, etc, click the Format button, click the appropriate commands, select the options you want in the respective dialog boxes, and then click OK.
    • If you want the style you are creating to be available for new documents, click the Add to template check box.
  6. Click OK.
Fig: New Style dialog box, showing paragraph style options.






How to Create a New Table Style
Among the numerous built-in styles that come with Word are several fantastic table styles. You can apply the formatting instructions contained in any of them to a table, or you can create your own custom table style to provide a consistent look to borders, shading, alignment, and fonts in tables.
  1. On the Format menu, click Styles and Formatting.
    The Styles and Formatting task pane is open.
  2. In the Styles and Formatting task pane, click New Style.
    The New Style dialog box is displayed.
  3. In the Name box, type a name for the style, e.g My Table Style.
  4. In the Style type box, click Table.
  5. Under Formatting, select the formatting options -such as font, size, color, line style, width for border lines, line color, shading, and vertical alignment of text - you want.
    • To add more formatting options, click the Format button, click the appropriate command, select the options you want in the respective dialog boxes, and then click OK. 
    • If you want the style you are creating to be available for new documents, click the Add to template check box.
  6. Click OK.



    The style name of the new table style has been added to the style list. You can reuse a new table style by selecting it in from the Styles and Formatting task pane, or from the Table AutoFormat dialog box.
Fig: New Style dialog box, showing table style options.





How to Create a New List Style
  1. On the Format menu, click Styles and Formatting.
    The Styles and Formatting task pane is open.
  2. In the Styles and Formatting task pane, click New Style.
    The New Style dialog box is displayed.
  3. In the Name box, type a name for the style, e.g My List Style.
  4. In the Style type box, click List.
  5. Under Formatting, select the formatting options -such as font, size, color, starting number (if necessary), level,numbering, bullets, insert picture, symbol and indents. - you want.
    • To add more formatting options, click the Format button, click the appropriate command, select the options you want in the respective dialog boxes, and then click OK. 
    • If you want the style you are creating to be available for new documents, click the Add to template check box.
  6. Click OK.



    The style name of the new list style has been added to the style list. You can reuse a new list style by selecting it in from the Styles and Formatting task pane, or from the List Styles tab in the Bullets and Numbering dialog box.
Fig: New Style dialog box, showing list style options.







How to Rename Styles
  1. On the Tools menu, click Templates and Add-Ins.
    The Templates and Add-ins dialog box is displayed.
  2. Click Organizer.
    The Organizer dialog box is displayed.
  3. Click the Styles tab.
  4. In the In [Document name] box on the left, click the style you want to rename, and then click Rename.
    The Rename dialog box appears.
  5. In the Rename dialog box, type a new name for the style, and then click OK.
  6. Click Close.









How to Delete Styles
If you have a custom style you know you won't be needing again, you can easily delete it. If you delete a paragraph style that you created, Word applies the Normal style to all paragraphs that were formatted with that style and removes the style name from the task pane.You can quickly delete a single style via the task pane, or delete multiple styles via the Tools menu.
To delete a style using the task pane.
  1. On the Format menu, click Styles and Formatting.
    The Styles and Formatting task pane is open.
  2. In the Styles and Formatting task pane, right-click the style you want to delete, and then click Delete.
  3. When Word displays a message box asking whether you want to delete the style, click YES.
Delete Multiple Styles
Fig:Organizer dialog box
  1. On the Tools menu, click Templates and Add-Ins.
    The Templates and Add-Ins dialog box appears.
  2. Click Organizer, and then click the Styles tab in the Organizer dialog box that is displayed.
  3. To delete items from a different template or file, click Close File to close the active document and its attached template or to close the Normal template. Then click Open File, and open the template or file you want.
  4. Click the items to delete, click Delete and then click YES in the message box that appears.
  5. Click Close to return to the document.

    a



    To print a dictionary-style header on a page, first, you'll need to format the items with a character or paragraph style; after that, you will have to insert the STYLEREF field in the header area where you want each item to appear. Basically, you will have to insert two STYLEREF fields in the document header. The fields should be of these formats: {STYLEREF "STYLE NAME"} and {STYLEREF "STYLE NAME" \l}. The first field (which will eventually display the first item on the page), contains the STYLEREF field and the style of the items on the page, e.g {STYLEREF "HEADING 2"}. The second field (which will eventually display the last item on the page) contains the STYLEREF field, the style of the items on the page, and an \l switch, e.g {STYLEREF "HEADING 2" \l}. The \l switch instructs Word to search from the bottom of the current page to find the first text formatted with the style you entered in the field.

    Here are the steps you can follow to create a dictionary-style header, in which, Word displays and prints at the top left and the top right of each page (in the header area) the first and last items appearing on that page that are formatted with a specific style
    1. Format the items in the document by using a paragraph or character style.
    2. On the View menu, click Header and Footer.
      The Header and Footer toolbar is displayed.
    3. You will insert two STYLEREF fields in the document header, by doing the following:
      1. Make sure the insertion point is positioned at the extreme left of the header area. 
      2. On the Insert menu, click Field.
        The Field dialog box is displayed.
      3. In the Categories box, click Links and References.
      4. In the Field names box, click StyleRef.
      5. In the Style name box, under Field properties, click the name of the style (e.g Heading 1) you used in formatting the items in the document (in step 1).
      6. Click the OK button.
        The first item (text) found to be formatted with the specified style in the page (or section/document) is inserted at the insertion point.
        * If Word does not find any text in the current page that is formatted with the style you specified , it searches through the pages that follow, to the end of the document. If none is found either, the following sentences are displayed instead: Error! No text of specified style in document.
      7. Press TAB twice to move the insertion point to the extreme right of the header area.
        If a trail of gray shading follows the insertion point after you pressed TAB, press BACKSPACE to move the insertion point back, and then click an empty (white) space in the header area before pressing TAB again. This will help remove the trail of gray shading.
      8. Repeat steps 3(ii) through 3(v) above.
      9. Under Field options, click the Search from bottom of page to top check box.
        This is the option that will insert the {STYLEREF "STYLE NAME" \l} field and display the last item formatted with the specified style.
      10. Click OK.
        The last text in the current page or document that is formatted with the style you specified is displayed at the insertion point.
    4. Click the Close button on the Header and Footer toolbar to return to the document.



    Tip
    If you know the field code for the field you want to insert, you can skip the procedure above,  press CTRL+F9, and then type the code directly within the brackets inserted into the document.



    Effects of the STYLEREF field location
    Now that we are on the subject, I think it would be pertinent to discuss with you how the location of the STYLEREF field affects the result, so that it does not shock you if you get unexpected result when creating a dictionary-style header. Where you insert the STYLEREF field determines the direction that Word searches in for the style and consequently can affect which text is inserted. The STYLEREF field can be inserted in the document text, headers and footers, and footnotes, annotations and endnotes.

    When you insert the field in:

    Document text
    Word searches for the closest text preceding the STYLEREF field. If no text formatted with the style is found, Word searches for the closest following text.
    Headers and footers 
    How inserting the STYLEREF field in headers and footers determine the search direction, and the text inserted depends on any of two circumstances: when not printing, and during printing.
    •  When not printingWord searches for the section that contains the STYLEREF field, from the beginning. If it does no find the style, it searches from the end of the section to the end of the document.
    • During printingWord searches for the current page, from top to bottom. If the style is not found, Word searches next from the top of the page to the beginning of the document, and then from the bottom of the page to the end of the document. If the \l switch is used, Word searches from the bottom of the page to the beginning and then the end of the document. 
    Footnotes, annotations, and endnotes
    Word searches for the closest text preceding the footnote, annotation, or endnote reference mark in the document text. If no entry formatted with the style is found, Word searches for the closest text following the reference mark.





    EXERCISES


    Exercise 1

    The following table summarizes the information on the electrical systems in use in most countries of the world.

    Region Type (s) of plug / socket Voltage Frequency
    Afghanistan C, D, F 240 V 50 Hz
    Albania C, F 220 V 50 Hz
    Algeria C, F 230 V 50 Hz
    American Samoa A, B, F, I 120 V 60 Hz
    Andorra C, F 230 V 50 Hz
    Angola C 220 V 50 Hz
    Anguilla A, B 110 V 60 Hz
    Antigua A, B 230 V 60 Hz
    Argentina C, I 220 V 50 Hz
    Armenia C, F 230 V 50 Hz
    Aruba A, B, F 127 V 60 Hz
    Australia I 230 V 50 Hz
    Austria C, F 230 V 50 Hz
    Azerbaijan C 220 V 50 Hz
    Azores C, F 220 V 50 Hz
    Bahamas A, B 120 V 60 Hz
    Bahrain G 230 V 50 Hz
    Balearic Islands C, F 220 V 50 Hz
    Bangladesh A, C, D, G, K 220 V 50 Hz
    Barbados A, B 115 V 50 Hz
    Belarus C 220 V 50 Hz
    Belgium C, E 230 V 50 Hz
    Zimbabwe D, G 220 V 50 Hz


    *Adapted  from http://en.wikipedia.org/wiki/Mains_power_around_the_world
    **For the sake of space, I could not display the full information on the table here. 
    ***Original copy of the table contains more comprehensive information. Please visit http://en.wikipedia.org/wiki/Mains_power_around_the_world for fuller information.


    Instruction:
    Using the STYLEREF field in a header, print at the top of each page the first and last names of countries and the electrical voltage they use as they appear in the table on each page.


    Solution Guide/Tips:
    Step 1:
    Format the Region column with a character style. Use the built-in HYPERLINK style, since the regions/countries already contain hyperlinks. Next, create a new character style with which to format the Voltage column. Name the new character style VOLTAGE, and let it contain the following group of formatting commands: 14-point, bold Times New Roman font.
    Step 2:
    Insert two STYLEREF fields at the extreme left of the header area, and another two STYLEREF fields at the extreme right of the header area. The first and second STYLEREF fields at the left side of the header area will use the code {STYLEREF "HYPERLINK"} - {STYLEREF "VOLTAGE"}, respectively, to display the name and the voltage being used by the first country on the page; while the STYLEREF fields at the extreme right will use the codes {STYLEREF "HYPERLINK" \l} - {STYLEREF "VOLTAGE" \l} to display the name and the voltage being used by the last country on the page.

    Let's now create the dictionary-style header following the steps enumerated in the solution guide/tips above.
    1. Copy and paste the table in a new blank document in Word. You may visit the source site and get the full table so you can have multiple pages to work on in your document.
    2. On the Format menu, click Styles and Formatting.
    3. Click New Style on the Styles and Formatting task pane.
    4. In the New Style dialog box, type VOLTAGE in the Name box, select Character in the Style type box, under Formatting, select Times New Roman, 14, and Bold options, and then click OK.
      VOLTAGE now appears in the Styles and Formatting task pane as a style name.
    5. In the Voltage column, click the cell in the second row (the cell containing 240V), and drag down to the last cell in the (Voltage) column to select them, and then click VOLTAGE in the Styles and Formatting task pane to format the text with the VOLTAGE style.
      If the text in the Region column do not contain hyperlinks in your document, select the entire column and then click Hyperlink in the Styles and formatting task pane.
      Next we create the dictionary-style header.
    6. On the View menu, click Header and Footer.
      The Header and Footer toolbar is displayed, with the insertion point positioned at the left of the header area.
    7. Use any of the following methods to create the dictionary-style header:
      • Using the Insert menu
        1. On the Insert menu, click Field.
          The Field dialog box is displayed.
        2. Under Categories, click Links and References and then click StyleRef in the Field names list box.
        3. In the Style name box, under Field properties, click Hyperlink, and then click OK.
        4. Click outside the text inserted in the header, press the SPACEBAR once, and then type a hyphen (-).
        5. Repeat steps 7*(i) through 7*(iii) above, but select VOLTAGE in the Style name box instead, and then click OK.
        6. Click outside the inserted text and the press TAB twice.
        7. Repeat steps 7*(i) through 7*(iii) above, but click the Search from bottom of page to top check box, before clicking OK.
        8. Repeat steps 7*(iv) through 7*(v) above, but click VOLTAGE in the Style name box, this time before clicking the Search from bottom of page to top check box, and then click OK.
      • Using the Direct Typing Method
        1. Press CTRL + F9, click outside the curly brackets that appear, press the SPACEBAR once, type a hyphen (-), press the SPACEBAR again, press CTRL + F9 , click outside the curly brackets that appear, press TAB twice to move the insertion point to the right of the header area, and then insert another two curly brackets (fields) seperated by a hyphen as you just did before pressing TAB.
        2. Type STYLEREF "HYPERLINK" within the first curly brackets at the left, type STYLEREF "VOLTAGE" within the second brackets at the left, type STYLEREF "HYPERLINK" \l within the first brackets at the right of the header area, and then type STYLEREF "VOLTAGE" \l within the second brackets at the right side of the header area.
    8. Click the Close button on the Header and Footer toolbar.

      If you had executed each of the steps enumerated correctly, the header should be displaying at the left, the name and the voltage of the first country appearing on the page, while at the right side, the name and the voltage of the country appearing last on the page should also be displayed accordingly.
    Fig: Dictionary-style header created





    Exercise 2
    In the image below, the colored texts are Windows terms, being defined by the black indented paragraphs following them (See the Windows Glossary in the Help and Support Center of your Windows PC for more information)
    The Windows terms are copied and pasted into the document and are formatted with a custom paragraph style named TERMS, which has the following formatting properties:

    Font: Times New Roman, 24 pt, Font color: BlueLeft, Line spacing: single, Window/Orphan control, Keep with next.

    The black indented paragraphs are formatted with a custom paragraph style named DEFINITION, which consists of the following group of formatting instructions: 
    Font: Times New Roman, 24 pt, Font color: Black, Indent: Left:0.5", Justified, Line spacing: single, Window/Orphan control, Tabs: 0.5", Left.

    The document is saved with the filename "Windows Glossary", and is formatted with brown, top and bottom page borders, which do not surround the header and footer. The footer content reflects the filename of the document and page numbers; while the header displays the first and last Windows terms appearing on each page.

    Instruction:
    Study the image and create a dictionary-style header similar to it.

    Fig:Dictionary-style header image for exercise 2

    We appreciate you reading this guide in its entirety. Visit us again for news and useful advice in the future. It will be worthwhile for you to visit. I truly value your coming by and being here. If you find these instructions and advice useful and instructive, kindly tell your friends about our website. On the other hand, if you believe that there is any area that could use better, kindly share your suggestions. These will be much embraced and valued. Use the comment section below to provide suggestions or ask questions. Your questions will be swiftly investigated and properly addressed, and your comments will be promptly examined and published. Thanks.