709-218-7927

The Landfall Garden House

60 Canon Bayley Road

CANADA A0C 1B0

CPRGreaves@gmail.com

Home

Christopher Greaves

Prevois: Templates From Scratch

Templates and Document structure

Connections between a document and its template

Word documents are based on templates. When you create a new document, the new document takes on the page margins, paragraph styles, and content of the underlying template. (If you don't explicitly select some other template, your new document will be based on Word's default template, which is called Normal.Dot.)

Most connections between a document and its template are broken immediately after the document is created, so you can make changes to the template without affecting existing documents and vice versa. For example, the template's page margins and content have no effect on existing documents; these settings affect new documents only. Changes in paragraph styles and character styles can have an effect on existing documents in special circumstances; but by default they affect new documents only.

Body of a page versus header and footer areas

In its default configuration (as shipped by Microsoft) Normal.Dot has top and bottom margins of one inch and left and right margins of 1.25 inches. On a letter-size sheet, this leaves an area six inches wide and nine inches tall for the body of the page. If you create a new document and immediately start typing, you're typing into this area (the body of the page).

In Normal.dot's default configuration, the distance from the top edge of the page to the top of the header is set to 0.5 inches. This means you can create a header up to 0.5 inches tall and it will still fit in the top margin of the page (which, recall, is one inch) without affecting the body of the page. (If you create a taller header, so that it extends downward past the top margin, into the body of the page, Word will shrink the body of the page to accommodate the height of the header. In effect, this means the top margin setting is a minimum setting; the body of the page will start at LEAST one inch down from the top of the page. If you put in a four-inch tall header, the body of the page will start below that.)

The distance from the bottom edge of the page to the bottom of the footer is set to 0.5 inches, too. The footer grows upward. This means you can create a footer up to 0.5 inches tall and it will still fit in the bottom margin of the page without affecting the body of the page. But if you create a taller footer, so that it extends upward past the bottom margin, into the body of the page, Word will shrink the body of the page to accommodate the height of the footer. In effect, this means the bottom margin setting is a minimum setting; the body of the page will start at LEAST one inch up from the bottom of the page. If you put in a four-inch tall footer, the body of the page will start above that.

Interestingly, when you're entering text into the body of a page, you can't enter text into the header or footer. Likewise, when you're entering text into the header or footer, you can't enter text into the body of the page. So you have to switch the cursor back and forth. In a new document, which usually has nothing in the header or footer, you have to select Header and Footer on the View menu in order to switch the cursor back and forth. After you place some text into a header or footer, however, you can double-click the header or footer to switch the cursor to that area and double-click the body of the page to switch the cursor back. (This assumes that you're in Page Layout view. In Normal view, you must always rely on a menu command to switch the cursor back and forth.)

If you don't like Normal.dot’s page margins or the header and footer distance settings, you can open Normal.Dot and use the Page Layout command on the File menu to change them. Or you can open a document that happens to be based on Normal.Dot and use the Page Layout command and then simply click the Default... button in the Page Layout dialog box.

Paragraph attributes

In Word, paragraphs flow between the margins of the page. That is, the first paragraph starts at the top of the page at the left margin and flows until it hits the right margin at which point it wraps back to the left margin and continues on in this fashion until the end of the paragraph is reached. (Actually, a paragraph can be indented from the left and/or right, in which case it may not flow all the way to the page margins.)

A paragraph has a surprising number of attributes. To see them, choose the Paragraph command on the Format menu. They include alignment, indentation, and spacing attributes plus the following "pagination" attributes: window/orphan control, keep together, keep with next, and page break before. It's easy enough to experiment with these attributes to see what effect each has on the appearance of the paragraph.

The biggest surprise may be this: Paragraph attributes apply to the entire paragraph. If you choose the Paragraph command while the cursor is flashing in a particular paragraph, only that paragraph (but ALL of it, not just part of it) will take on the selected attributes. If you choose the command while two or more paragraphs are selected, all selected paragraphs, including those that are only partially selected, will take on the selected attributes.

Spacing attributes include space before and space after. Think about this! No need to add hard returns before or after a paragraph in order to create space between paragraphs. Simply set the spacing attributes to suit your purposes. (This sounds like it would be a lot harder than simply adding a few hard returns but don't decide for sure until you read the topic after this one.)

When line spacing is set to Single, Word adjusts the line spacing based on the size characters that you type. If you change a single character to a larger point size, Word will adjust the spacing of the line to accommodate that character. Likewise, if you insert an inline graphic (one that acts like a character, in that it maintains its position between the preceding and succeeding characters), Word will adjust the spacing of the line to accommodate the graphic.

When line spacing is set to an explicit value (say, 12 points), Word doesn't adjust the line spacing. Characters or graphics that are too tall to fit in this space will be truncated to fit.

Paragraph styles

Applying a paragraph attribute might seem unnecessarily clumsy in Word but after you understand the philosophy behind Word's approach, you begin to appreciate the thinking that went into it. Consider:

If you want a paragraph to be right-justified, with 12 points of space before it, with 18-point line spacing, there's no doubt about it: you'll need to issue a hot-key command for each of these attributes (three commands in all) or else you're going to have to open the Format Paragraph dialog box and click three times to select these attributes. That's the bad news.

The good news is that never again will you have to issue three commands in order to apply these attributes to another paragraph. Never! Instead, immediately after setting up your first paragraph this way, you can choose Format Style and assign a name to this collection of attributes. The collection of attributes thereby becomes a style. In this case, you might call this style "Peculiar." Fine! The next time you want a paragraph to be right-justified, with 12 points of space before it, with 18-point line spacing, you'll choose Format Style and select Peculiar. Better yet, simply pull down the Style list on the Formatting toolbar and select Peculiar. No need to view a dialog box at all.

After applying a style (i.e., a collection of attributes) to a paragraph, you might wonder how in the world you can tell what those attributes are, especially since you don't have a reveal codes command to rely on. Well, there are several ways. First, you can simply look at the paragraph! If it's right justified, you'll know it. If it has 12 points of space before it, you'll see it. If it has 18-point line spacing, you'll see that, too. Second, you can position the cursor in the paragraph and look at the Style list on the Formatting toolbar. If your paragraph has been styled with the Peculiar style, you'll see Peculiar listed in the Style list. Third, you can position the cursor in the paragraph and choose Paragraph on the Format menu. This brings up a dialog box that shows the current setting of all attributes. Fourth, you can click the What's This? tool and then click the paragraph. This brings up a help balloon that explains the formatting applied to the paragraph and to the characters.

Paragraph marks

Here's a truly surprising thing about paragraph marks: they store the paragraph attributes for the entire paragraph. Copy a paragraph mark from one paragraph and paste it at the end of a second paragraph and the second will take on the attributes from the first! The paragraph attributes are stored in the mark!

Document Sections

Word documents are divided into sections. A new document typically has just one section. (An exception would be a document based on a template that contains two or more sections. Such a document would start out with the same number of sections as its template.)

Each section of a document ends with a section break, just as each paragraph ends with a paragraph mark. The only exception is the last section of the document, which ends in a paragraph mark with no section break.

A section has a surprising number of attributes. Unfortunately, there isn't a single dialog box that displays them all. Instead, they are scattered among several dialog boxes.

Section attributes include the following:

To see the dialog boxes where these attributes can be edited, place the cursor in the section you're interested in, then choose the following commands, one at a time:

Section breaks

Section breaks store section attributes in the same way that paragraph marks store paragraph attributes. Copy a section break from one section and paste it at the end of a second section and the second section will take on the attributes from the first! The attributes are stored in the section break! (The last paragraph mark in a document stores both paragraph attributes and section attributes. Copy this paragraph mark to a different document and you'll copy not only the paragraph attributes but the attributes of the last document section as well. This can lead to unexpected results.)

Templates and predefined content

If a template contains two paragraphs of text in the body of the first page, a document based on that template will start out with the same two paragraphs of text. If a template contains a header and a footer, a document based on that template will start out with that header and that footer.

Templates and custom features

In addition to providing a new document with page margins, paragraph styles, and possibly some pre-defined content, a template can provide access to powerful custom features created by the user. These include AutoText entries and macros.

AutoText entries are chunks of reusable content, which can range from as little as a single word or drawing object or table to as much as an entire document section. When you create an AutoText entry (which is a piece of cake) you choose which template to store it in. From then on, whenever you're working on a document based on that template, you can insert the AutoText entry by choosing the AutoText command on the Insert menu.

Macros are series of commands that can be carried out with a single keystroke or mouse click. You can record a series of commands or you can launch the VBA editor and enter a series of commands manually. The resulting macro can be assigned to a key or key combination or to a toolbar button or to a menu command. When you create a macro, you choose which template to store it in. From then on, whenever you're working on a document based on that template, you can run the macro by pressing the assigned key or key combination or by clicking the assigned toolbar button or menu command.

Creating a template

You can save a document as a template simply by choosing Word Template in the File | SaveAs dialog box. Or you can create a new template based on some other template by choosing File | New | Template...

Next: Understanding the Template Path and Normal.dot

709-218-7927 CPRGreaves@gmail.com

Bonavista, Thursday, December 17, 2020 7:34 AM

Copyright © 1996-2020 Chris Greaves. All Rights Reserved.