ࡱ > s
v
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
|
q` bjbjqPqP p : : , 8 # # # # # # # $ # P > R
# * x Z , B B B , . d m o o o o o o $ h
Q # O O O # # B B an an an O # B # B m an O m an an b A # # B N ` CV < ͼ V ! L0 0 * # ] X # ! ! +0 x
: z an B H f +0 +0 +0 n X +0 +0 +0 * O O O O # # , P d * N # # P * # # # # # # # # # Overview of WordprocessingML
Microsoft CorporationNovember 2003
2003 Microsoft Corp. All rights reserved.
The information contained in this document represents the current view of Microsoft Corp. on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.
This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording or otherwise), or for any purpose, without the express written permission of Microsoft Corp.
Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights or other intellectual property.
Microsoft, ActiveX, Outlook, and Visual Basic are either registered trademarks or trademarks of Microsoft Corp. in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
Microsoft Corp. One Microsoft Way Redmond, WA 98052-6399 USA
Table of Contents
TOC \o "1-3" \u Introduction PAGEREF _Toc56484278 \h 5
Structure of This Document PAGEREF _Toc56484279 \h 5
Section 1: WordprocessingML Overview PAGEREF _Toc56484280 \h 6
Top-Level Elements, Namespace, Basic Document Structure PAGEREF _Toc56484281 \h 6
Tying the Document to Microsoft Word PAGEREF _Toc56484282 \h 7
Section 2: Adding Text to the Document PAGEREF _Toc56484283 \h 8
The t (Text), r (Run), and p (Paragraph) Elements PAGEREF _Toc56484284 \h 8
Sections PAGEREF _Toc56484285 \h 8
Organizing Text PAGEREF _Toc56484286 \h 9
Inserting Breaks PAGEREF _Toc56484287 \h 10
Creating Paragraphs PAGEREF _Toc56484288 \h 11
Tabs PAGEREF _Toc56484289 \h 11
Section 3: Formatting Text PAGEREF _Toc56484290 \h 13
Formatting Runs of Text PAGEREF _Toc56484291 \h 13
Formatting Paragraphs PAGEREF _Toc56484292 \h 15
Styles PAGEREF _Toc56484293 \h 16
Using Styles PAGEREF _Toc56484294 \h 16
Defining Styles PAGEREF _Toc56484295 \h 17
Extending Styles PAGEREF _Toc56484296 \h 18
Style Properties PAGEREF _Toc56484297 \h 20
Property Conflicts PAGEREF _Toc56484298 \h 23
Fonts PAGEREF _Toc56484299 \h 24
Specifying Fonts PAGEREF _Toc56484300 \h 24
Using Fonts PAGEREF _Toc56484301 \h 24
Formatting a Section PAGEREF _Toc56484302 \h 25
Setting a Pages Size and Margins PAGEREF _Toc56484303 \h 25
Columns PAGEREF _Toc56484304 \h 26
Section 4: Document Components PAGEREF _Toc56484305 \h 26
Lists PAGEREF _Toc56484306 \h 27
Headers, Footers, and Title Pages PAGEREF _Toc56484307 \h 31
Tables PAGEREF _Toc56484308 \h 34
Document Properties PAGEREF _Toc56484309 \h 37
Document Information PAGEREF _Toc56484310 \h 37
Section 5: Other Topics PAGEREF _Toc56484311 \h 38
Graphics PAGEREF _Toc56484312 \h 38
Bookmarks PAGEREF _Toc56484313 \h 40
Fields PAGEREF _Toc56484314 \h 40
Simple Fields PAGEREF _Toc56484315 \h 41
Complex Fields PAGEREF _Toc56484316 \h 41
Hyperlinks PAGEREF _Toc56484317 \h 44
Macros and Components PAGEREF _Toc56484318 \h 46
Section 6: Auxiliary Elements PAGEREF _Toc56484319 \h 47
Sections and Subsections PAGEREF _Toc56484320 \h 47
The sect Element PAGEREF _Toc56484321 \h 48
The sub-section Element PAGEREF _Toc56484322 \h 49
Using the sect and sub-section Elements PAGEREF _Toc56484323 \h 50
Auxiliary Attributes of the Tab Element PAGEREF _Toc56484324 \h 51
The Auxiliary font Element PAGEREF _Toc56484325 \h 52
The Auxiliary estimate Attribute PAGEREF _Toc56484326 \h 52
Reference PAGEREF _Toc56484327 \h 52
Table 1: WordprocessingML Elements PAGEREF _Toc56484328 \h 52
Table 2: rPr Child Elements (Run Properties) PAGEREF _Toc56484329 \h 54
Table 3: pPr Child Elements (Paragraph Properties) PAGEREF _Toc56484330 \h 56
Table 4: sectPr Child Elements (Section Properties) PAGEREF _Toc56484331 \h 59
Table 5: style Element Attributes PAGEREF _Toc56484332 \h 60
Table 6: style Child Elements (Style Definitions) PAGEREF _Toc56484333 \h 60
Table 7: tab Element Attributes PAGEREF _Toc56484334 \h 61
Table 8: WordprocessingML Auxiliary Elements and Attributes PAGEREF _Toc56484335 \h 62
Table 9: docPr Child Elements (Document Properties) PAGEREF _Toc56484336 \h 62
Table 10: Table-Related Elements PAGEREF _Toc56484337 \h 70
Table 11: tblPr Child Elements (Table Properties) PAGEREF _Toc56484338 \h 71
Table 12: tblpPr Child Elements (Table Positioning Properties) PAGEREF _Toc56484339 \h 72
Table 13: trPr Child Elements (Table Row Properties) PAGEREF _Toc56484340 \h 73
Table 14: tcPr Child Elements (Table Cell Properties) PAGEREF _Toc56484341 \h 74
Table 15: listDef Child Elements (List Definitions) PAGEREF _Toc56484342 \h 75
Table 16: lvl Child Elements (List-Level Definitions) PAGEREF _Toc56484343 \h 75
Table 17: nfc Element Integer Values PAGEREF _Toc56484344 \h 76
Introduction
This document describes the elements in the WordprocessingML Schema that are important to document developers and to application developers whose programs will read and write WordprocessingML documents. The text assumes that you have a basic understanding of XML 1.0, XML namespaces, and the functionality of Microsoft Office Word. Each major section of this document introduces new features of the language and describes those features in the context of concrete examples.
In this document, youll see how to:
Create a document with typical Word structures (paragraphs and sections)
Add typical document components, including lists, tables, headers, footers, and title pages
Format your documents by specifying formatting at any level within the document
Define and use styles
Insert graphics, bookmarks, hyperlinks, and fields into your document
Following this introduction to WordprocessingML is a reference to the WordprocessingML elements that are most useful to developers.
Structure of This Document
After an initial overview of WordprocessingML and document-level properties and information, this whitepaper looks at WordprocessingML topics in the order that developers will presumably need them. This structure means that some elements are not discussed in detail in one location. For instance, the documentProperties element contains elements that affect how fields and headers are handled. As a result, the child elements of the documentProperties element are discussed in two different places in the document.
Section 1: An overview of WordprocessingML that describes the simplest possible WordprocessingML document and a summary of the top-level WordprocessingML elements.
Section 2: Adding content to WordprocessingML document as unformatted text.
Section 3: Formatting text, including defining and using styles.
Section 4: Adding additional components to documents including lists, tables, headers, and footers. Also covered in this section are the document information and properties sections.
Section 5: Other topics: bookmarks, hyperlinks, fields.
Section 6: The auxiliary elements added by Word to a WordprocessingML document to provide information about the document.
Reference: Tables that list and describe the WordprocessingML elements.
Section 1: WordprocessingML Overview
Top-Level Elements, Namespace, Basic Document Structure
The top-level elements in a WordprocessingML document are:
Document information (documentProperties element)
Font information (fonts element)
List-style definitions (lists element)
Style definitions (styles element)
Drawing defaults (shapeDefaults element)
docSuppData element (Microsoft Visual Basic for Applications [VBA] code)
Document options (docPr element)
The documents content (body element)
However, the simplest Word document consists of just five elements (and a single namespace). The five elements are:
ElementDescriptionwordDocumentThe root element for a WordprocessingML document.bodyThe container for the displayable text.pA paragraph.rA contiguous set of WordprocessingML components with a consistent set of properties.tA piece of text.The namespace for the root WordprocessingML Schema (also known as the XML Document 2003 Schema) is http://schemas.microsoft.com/office/word/2003/wordml. This namespace is normally associated with the WordprocessingML elements by using a prefix of w. The simplest possible WordprocessingML document looks like this:
Hello, World.
In Figure 1, you can see the resulting document, displayed in Microsoft Word.
Figure 1. A WordprocessingML document in Microsoft Word
Tying the Document to Microsoft Word
If you save a Word document with the .xml extension, Windows will treat the file like any other XML file. Double-clicking the file, for instance, will open it in the standard XML processor (usually Microsoft Internet Explorer). However, adding the mso-application processing instruction specifies Word as the preferred application for processing the file. As a result, Word will open the XML document when the user double-clicks the documents icon. This example shows the sample document with the mso-application element added:
Hello, World.
A side effect of this automatic behavior, however, is that it prevents the display in Internet Explorer of the XML markup of XML files saved by Word. You can temporarily disable this behavior by deleting the following registry entry and value
Word.Document = application/msword
from the following subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\Filter\text/xml
Section 2: Adding Text to the Document
The documents content is held in the body element. Text within the body element is kept in a nested set of three elements: t (a piece of text), r (a run of text within a paragraph), and p (a paragraph).
The t (Text), r (Run), and p (Paragraph) Elements
The lowest level of this hierarchy is the t element, which is the container for the text that makes up the documents content. You can put as much text as you want in a t elementup to and including all your documents content. However, in most WordprocessingML documents, long runs of text will be broken up into paragraphs and strings with different formats, or be interrupted by line breaks, graphics, tables, and other items in a Word document.
A t element must be enclosed by an r elementa run of text. An r element can contain multiple occurrences of t elements, among other elements. The r element allows the WordprocessingML author to combine breaks, styles and other components but apply the same characteristics to all the parts of the run. All of the elements inside an r element have their properties controlled by the rPr element (for run properties), which is the first child of the of the r element. The rPr element, in turn, is a container for a set of property elements that are applied to the rest of the children of the r element. The elements inside the rPr container element allow you to control, among other options, whether the text in the following t elements is bold, underlined, or visible.
Sections
In a WordprocessingML document, the layout of the page that your text appears in is controlled by the properties for that section of the document. However, there is no container element for sections in WordprocessingML. Instead, the information about a section is kept inside a sectPr (section properties) element that appears at the end of each section. Though a sectPr element isnt necessary in a WordprocessingML document, Word always inserts a sectPr element at the end of any new document that it creates. Here is a typical sectPr element generated by Word when a document is created:
When new sections are added to a WordprocessingML document, the new sectPr elements must appear inside pPr elements (which are discussed later) inside p elements. This example shows a sectPr element added to a document to mark the end of a section:
Each sectPr element marks the end of a section and the start of a new section. The child elements of the sectPr element provide the definition of the section just ended. All the child elements for the sectPr element are listed in HYPERLINK \l "_Table_4:_sectPr_Child Elements (Sec" Table 4.
While WordprocessingML does not have a container for sections, Word does generate sect elements that act as containers for sections. These are not part of WordprocessingML but belong to the Auxiliary XML Document 2003 namespace (http://schemas.microsoft.com/office/word/2003/auxHint). The sect elements (and other auxiliary elements) are discussed later in this document.
Organizing Text
The following example has multiple t elements inside an r element (for the following examples, only the body element and its children are shown):
Hello, World.
How are you, today?
Although this document is valid, duplicating the t element isnt necessary. Therefore, the following example would give the same result as the previous one:
Hello, World. How are you, today?
Inserting Breaks
Typically, if you have multiple t elements in an r element, its because you need to insert some other element in between the pieces of text. In the following example, a br element appears between the two t elements. The br element will force the second t element to a new line when the text is displayed in Word:
Hello, World.
How are you, today?
The br elements type attribute allows you to specify the kind of break (page, column, text-wrapping). Because the default is text-wrapping (a new line), the type attribute in the previous example could have been omitted. Figure 2 shows the results of using a br element between r elements.
Figure 2. A Word document with a br element between t elements
Creating Paragraphs
You use p elements to define new paragraphs (a br element with text-wrapping is equivalent to the soft break in Word thats created by pressing SHIFT+ENTER and doesnt start a new paragraph). A WordprocessingML document with text in two separate paragraphs would look like this:
Hello, World.
How are you, today?
The resulting document can be seen in Figure 3. As comparing Figures 2 and 3 shows, depending on your formatting options, the difference between using br elements and p elements may not be visible. The display of a WordprocessingML document in Word may not reveal the underlying structure of the document.
Figure 3. A Word document with multiple p elements
Tabs
The tab element allows you to position text horizontally on a line. Tab elements move the following text to the next tab stop. Exactly where on the line that will be depends on how tab stops are defined in the document.
In this example, the text will appear on a single line but with each t elements text positioned at a separate tab stop:
Hello, World.
How are you, today?
Tab stops are defined in the pPr element, which is also a child of the p element. Within the pPr element, you can set the tab stops for the paragraph by using tab elements with the tabs element. Three attributes on the tab element define the tab stop:
val: The type of tab.
pos: The tabs position from the left edge of the document, in twips.
leader: The text to fill the empty space between tab stops.
For example, this paragraph has three tab stops at 1 inch (1,440 twips), 3 inches (4,320 twips), and 5 inches (7,200 twips), with each tab stop being a different type. In the example, the tab elements before the r element move the text to the second tab stop:
Hello, World.
Tabs function only if the xml:space attribute is present on the wordDocument element and is set to preserve:
HYPERLINK \l "_Table_7:_tab_Element Attributes" Table 7 lists the attributes for the tab element and the options that you can use.
Section 3: Formatting Text
The most powerful formatting tool discussed in this section is WordprocessingML styles. Although you can format your document by setting individual properties at the paragraph and run level, this approach may not be your best choice. If youre doing more than setting bold, underline, or italics for a single run, using styles to format your document makes it easier to manage the appearance of your document.
Formatting Runs of Text
The rPr (run property) element is a container that holds the property elements that define how a run is to be treated by Word. You can have multiple rPr elements within an r element. HYPERLINK \l "_Table_2:_rPr_Child Elements (Run Pr" Table 2 lists all of the elements that can be included inside the rPr element with their description (taken from the WordprocessingML schema).
Most the children of the rPr element have a single val attribute that is limited to a specific set of values. For instance, the b (bold) element causes the text that follows it to be bold when the b element has its val attribute set to on. In this example, both Hello, World. and How are you, today? will be bold because both sets of text are in the same run and follow the rPr element with the b element (note that the prefix w: on the val attribute is not optional):
Hello, World.
How are you, today?
Figure 4 shows the result of this change.
Figure 4. Text in an r element with the b element used in the rPr element to turn on bold formatting
If the val attribute isnt present for the b element, it defaults to on. So the element is equivalent to the element .
You can also use the b element to suppress bold formatting like this:
Hello, World.
How are you, today?
While most rPr elements use just the val attribute, there are exceptions (the asianLayout property, for instance, takes several attributes). HYPERLINK \l "_Table_2:_rPr_Child Elements (Run Pr" Table 2 provides the values for the val attribute for each of the rPr properties, provided that the list of values is short. Where the element has multiple attributes, doesnt use the val attribute, or has a large number of values, the table gives the name of the type definition in the WordprocessingML schema that describes the element.
For example, the underline element uses the val attribute but offers more choices than on and off. This example gives the text a single, continuous underline (other options include words, double, and thick):
How are you today?
The result appears in Figure 5.
Figure 5. Applying the u element to text
Formatting Paragraphs
The pPr element defines the properties for a paragraph. HYPERLINK \l "_Table_3:_pPr_Child Elements (Paragr" Table 3 lists the permitted child elements. For example, within the pPr element, the jc element is used to control the paragraphs alignment. In this document, the text in the paragraph will be centered (see Figure 6):
Hello, World.
How are you, today?
Figure 6. Centered text
Styles
Styles allow you to create a group of style properties that can be applied as a unit either to individual paragraphs (within the pPr element) or runs (within the rPr element). Styles reduce the amount of WordprocessingML text that you have to produce and the amount of work required to make changes to your documents appearance. With styles, changing the appearance of all the pieces of text that share a common style has to be done in only one place: the style definition.
Using Styles
The pStyle element inside the pPr element specifies which style is to be used for all runs in the paragraph. In the rPr elements, the rStyle element specifies the style for individual runs. The text inside the t elements will reflect a merging of the styles set at the pPr and set at the rPr level. There are no child elements in common between the pPr and rPr elements, so merging the two property sets is straightforward.
In this example:
The style MyStyle sets the paragraph-level properties.
MyFirstRunStyle sets the run-level properties for the text in the first t element.
MySecondRunStyle sets the run-level properties for the text in the second t element.
Hello, World.
How are you, today?
Defining Styles
Styles are defined in the WordprocessingML styles element, which is a top-level element under the wordDocument element. Within the styles element, each style element defines a single style. A style element is a container element for elements that define the style (all the children for the style element are listed in HYPERLINK \l "_Table_6:_style_Child Elements (Styl" Table 6).
The style element itself takes three attributes: type, styleId, and default:
The type attribute allows you to indicate what kind of style youre defining: paragraph, character, table, or list. Styles used in the pPr element must be paragraph styles; styles in the rPr element must be character styles.
The styleId attribute gives your style the name that you use to invoke the style in your WordprocessingML document.
When the default attribute is set to on, it indicates that this style is the default style for a particular type of style: paragraph, character, table, list.
In the following example, three styles are defined:
MyParagraphStyle, which is a paragraph style and is specified as the default style for paragraphs.
AnotherParagraph, which is also a paragraph style.
EmphasisStyle, which is a character style.
The following sample applies those styles. AnotherStyle is used for the first paragraph in the document. In the second paragraph, no paragraph style is specified, so the second paragraph will be formatted using the default style (MyParagraphStyle). However, within the r element in the second paragraph, a character style is used to control the appearance of the text:
Hello, World.
How are you, today?
Extending Styles
To create a style by extending another style, you use the basedOn element. The basedOn element allows you to create variations on a style by adding or overriding the properties of the base style. This example defines an Italic style and then uses it as the base for a ItalicBold style:
Hello, World.
The order of the style elements with the styles element doesnt matter: a basedOn style can extend style elements that precede or follow it.
Other useful child elements of the style element include:
name: Establishes the name to be displayed in the Style drop-down list in Word. Using the name element along with the styleId attribute allows you to use a terse name for the styleId (thereby reducing the text in the WordprocessingML document) while presenting a more descriptive or friendly name to the Word user.
locked: Prevents users from redefining the style.
hidden: Prevents users from seeing a style.
next: Specifies the style to be used on the new paragraph created when the user presses the ENTER key at the end of the current paragraph.
As a more comprehensive example, the following style element establishes:
A style called ReferenceName.
In Word, the user will see the style called DisplayName in the Style drop-down list.
The style is locked to prevent it from being redefined by the user.
When the user presses the ENTER key, the next paragraph will be in the ItalicBold style.
Although the hidden element is used, its val attribute is set to off, so the style will be visible in Word (which is the default for this element).
This paragraph uses the style just defined, by setting the val attribute to the name specified in the styles styleId attribute:
Hello, World
Figure 7 shows the style applied to the first paragraph in the document. On the Formatting toolbar in Word, the Style drop-down list shows the name established for the style through the name element in the style element. The second paragraph in Figure 7 was created by pressing the ENTER key at the end of the first paragraph and is in the ItalicBold style, as specified by the next element.
Figure 7. The DisplayName style in use
Style Properties
You define a style by adding child elements to the style elements (all of the children are listed in HYPERLINK \l "_Table_6:_style_Child Elements (Styl" Table 6). Within the style element, rPr and pPr elements allow you to define the formatting to be used at the r and p levels. The only limitation is that pPr elements used in a character style are ignored (and, as mentioned before, you can only refer to paragraph styles within a pPr element and only to character styles within an rPr element).
Putting it all together, this document defines a style that sets the justification for the paragraph (in the pPr element of the style) and combines bold and italic (in the rPr element of the style). The style is then used to format a paragraph:
Hello, World.
The result of applying this paragraph style using the pPr element inside the body element is that the text will be italic, bold, and centered.
If you violate the restrictions that Word puts on using styles, Word wont raise an error but Word also wont apply your styles. Consider this example, which is similar to the previous example but has some key changes that prevent the style from being applied:
Hello, World.
In this example, the ItalicBold style has its type attribute set to character. The result is that Word will ignore the use of the style in the pPr element inside the body element.
In this example, the character version of the style is used correctly inside the rPr element but the result will still not reflect all of the settings made in the ItalicBold style:
Hello, World.
Because the style is specified as being a character style, the pPr element in the style definition (where the center justification is specified) will be ignored. The rPr element inside the style is applied, though. As a result, the text will be bold and italic but not centered.
You could also make text centered, bold, and italic by making the ItalicBold style the default paragraph style and by not specifying a style at the paragraph level:
Hello, World.
Property Conflicts
Because properties can be set at the style, p, and r element levels, Word must deal with conflicts between the three levels. In this example, for instance, Word must reconcile:
The bold setting in the rPr element before the text.
Any bold setting that might be made in the character style, MyFirstRunStyle.
Any bold setting made in the paragraph style, MyStyle.
Finally, Word must deal with any bold setting made in the default character or paragraph styles:
Hello, World.
Three rules are used to reconcile settings for properties that are either on or off:
The local setting controls the text: settings made in the rPr or pPr elements for the run override any settings made in a style.
When styles are applied using the pStyle or rStyle elements, if either of the styles turns on the feature, then the feature is turned on.
The setting in the default style is only relevant if no explicit style is applied to the text and no local setting is made.
Applying the rules to the previous example, the text Hello, World will be bold because of the b element in the rPr element of the run. If the b element hadnt been used in the rPr element, then if either MyStyle or MyFirstRunStyle turned on bold formatting, the text would be boldeven if one of the styles turned bold off. Finally, any bold setting in a default paragraph or character style would apply only if no style was applied to the text.
Fonts
WordprocessingML provides two separate kinds of support for fonts:
Providing Word with information about the fonts used in the document.
Controlling the font used to display the text in the document.
Specifying Fonts
You can specify which fonts are used in your document by using the fonts element. For each font that you use, you can specify a variety of properties that allow Word to manage the documents fonts and make appropriate substitutions when the requested font isnt available. Setting these properties requires an understanding of font information thats beyond the scope of this document. The fonts element has no direct effect on your documents appearance but is simply a place to supply Word with information about the fonts used by the document.
Using Fonts
Within the fonts element, the defaultFont element specifies the default fonts for the document. This element directly controls which font is to be used to display the text in the document (unless overridden by a style or an rPr child element).The defaultFont element has a set of attributes that let you specify the default fonts for four character sets: ascii, fareast, h-ansi, and cs (complex scripts, for example, those scripts that allow bidirectional rendering). The defaultFont element is one of the elements that control what font is to be used in displaying the document.
You can override the default font by using the rFonts element in the rPr element. This can be done either in the rPr element preceding the t element with the text, in an rPr element inside a pPr element, or in a style. The rFonts element takes the same attributes as the defaultFonts element. For example, the following element sets the font for a run to Tahoma:
Hello, World
The font that you use to display your text doesnt have to be listed in the fonts element at the start of the document. However, without the information in the fonts element, if the font that you specify in the rFonts element isnt available on the computer where Word is displaying the document, Word may not make the best choice in selecting a substitute font.
Formatting a Section
At the section level, formatting information is held with the sectPr element at the end of the section. Within the sectPr element, child elements allow you to control the pages size and margins and to define columns for the page.
Setting a Pages Size and Margins
In the sectPr elements, there are two elements that control your pages layout:
pgSz: The page size element. The attributes of this element let you set the height and width of your page.
pgMar: The page margin element. The attributes of this element let you set the width of the left, right, top, and bottom margins.
The following pgSz element uses the w attribute to set a page width of 12,240 twips (8.5 inches) and the h attribute to set the height at 15,840 twips (11 inches):
The following pgMar element sets the top and bottom margins at 1,440 twips (1 inch) and the left and right margins at 1,800 twips (1.25 inches). In addition, the header and footer are 720 twips (0.5 inches) each.
The pgMar element also lets you specify how much space is to be set aside for the gutter, which is the part of the page that is lost to the binding process when pages are bound together. In the previous example, no space has been left for the gutter. This next example sets aside 360 twips (0.25 inches) for the gutter:
Typically, documents are bound down their inside edges. If your documents are bound along the top, youll need to specify that in the docPr element:
To force the gutter to the right side of the page, set the rtlGutter element to on in the sectPr element:
on
Columns
You can define columns in the sectPr element by using the cols element. If your columns are all the same width, you need only to specify the number of columns (in the num attribute) and the space between columns (in the space attribute):
If the columns have different widths, you must insert col elements inside the cols element. However, you must still specify the number of columns on the cols element. You must also turn off the equalWidth attribute.
For each col element except the last one, you specify the width of the column and the space following it.
You do not have to do anything further. Word will make the content of the t elements in the documents body flow, or snake, through the columns.
Section 4: Document Components
This section shows how to add lists, tables, headers, footers, and title page elements to a WordprocessingML document. Youll also see how to add both document properties and document information to your document.
Lists
In WordprocessingML, lists are a series of paragraphs that have a list style applied to them, with each item in the list in a separate paragraph. What distinguishes a list paragraph from an ordinary paragraph is the presence of a listPr element in the pPr element in the paragraph. The listPr element specifies the list style to be used with the paragraphs content and the level of the list. Here is a sample of a list with two items, which are represented by the two paragraphs with listPr elements:
Item 1
Item 2
Only two elements can appear inside the listPr element:
ilvl: The lists level number. This number is incremented as lists are nested within lists.
ilfo: The list style to use. This number must refer to a list style defined in the lists element.
As an example of the ilvl element in action, consider the list shown in Figure 8:
Figure 8. Example of the ilvl element in use
There are actually three lists in the example. First, there is an outer list with two items (Types of Web sites and WayFinding, numbered 1 and 2). Within those items are two nested lists. The first is the list consisting of Applications, Content, and Hybrid; the second list consists of Planning strategies and Executing plans with feedback. In WordprocessingML, this example consists of seven paragraphs, one for each list item. The paragraphs in different lists are at different paragraph levels and have different list styles assigned to them.
For the first three paragraphs, the WordprocessingML would look like this:
Types of Web sites
Applications
Content
The entry in the outermost list ("Types of Web sites) has an ilvl element with a val attribute of 0. The next paragraph, which is the first item of the nested list (Applications) has an ilvl element with a val attribute of 1, indicating that the paragraph is nested one level deep. All of the paragraphs use the same list style, specified in the ilfo element as 2.
The value in the ilfo element refers to a list element that appears inside the lists element before the body element. The list element, in turn, associates the ilfo element id with a particular list definition by using the ilst element. The following list element, for instance, defines list 1 as using list definition 2:
The list element can contain one other element, lvlOverride. The lvlOverride element contains elements that override settings in the list definition. These override settings can include a new starting number for the list and different formatting. By using the lvlOverride element, you can specify settings for a particular list (or part of a list) without having to create a whole new list definition.
The actual list definitions are defined inside the listDef element, which also appears inside the lists element. Within the listDef element, the listDefId attribute (which must be numeric) specifies the list name that is used in the ilfo element of the list element. All of the children of the listDef element are given in HYPERLINK \l "_Table_16:_lvl_Child Elements (List-" Table 16.
Within the listDef element, lvl elements define how the list items at each level are to be formatted. The format information inside an lvl element can include a pPr element (containing formatting for p elements) and an rPr element (containing formatting for r elements), among other elements. The pPr and rPr settings will automatically be applied to the p and r elements that make up the list items paragraph.
Also within the lvl element, the start element specifies the starting number for the list.
The following sample listDef style definition defines two levels of a list (Word typically generates eight levels of definition for a listDef element). The list definition is tied to the actual list in the body of the document through a list element. The example also demonstrates that linkage. Starting from the listDef element,
The listDef element has its listDefId attribute set to 2, identifying this as list definition 2.
Following the listDef element, a list element has the val attribute of its ilst element set to 2. This ties this list element to list definition 2.
The list element has its ilfo attribute is set to 1, which identifies this as list 1.
In the following body element, a listPr element has an ilfo element with its val attribute set to 1. This ties the listPr element back to list 1 which, in turn, is tied back to list definition 1.
Types of Web sites
Using the list element as an intermediary between the list definition in the listDef element and the listPr tag in the body makes it easy to change a style for a group of lists. Rather than rewrite the list definition or set all the lists in the document to use a different list definition, all thats necessary is to update the val attribute of the ilst element in the list element so that it points to a different listDef element. All the listPr tags that use that list element will now be displayed according to the new listDef element.
Headers, Footers, and Title Pages
WordprocessingML lets you add headers, footers, and a title page to your document. In WordprocessingML, headers and footers are just another kind of paragraph.
Headers and footers are defined in the sectPr element that marks the end of the section. In the sectPr element, the hdr element contains the definition of the header for the section, and the ftr element contains the definition for the footer. Within the hdr and ftr elements, the content of the element is treated like the content of the body element: p, r, and t elements are used to hold the text that makes up the header or footer.
Heres an example of the definition of a header and a footer:
My Header
My Footer
You can use any style that you want to control the formatting of a header or footer. A typical header style might look like this:
The hdr and ftr elements have a type attribute that takes one of three values: even, odd, and first. If youre only using one hdr or ftr element, the type attribute must be set to odd.
To have a different header (or footer) on even and odd pages, you will need two hdr elements, one with its type attribute set to even and one with its type attribute set to odd. For example:
My Odd Header
My Even Header
You must also add the evenAndOddHeaders element to the docPr element at the top of the document:
If you set the type attribute of a hdr or ftr element to first, the hdr or ftr will be used only on the first page (even if its the only hdr or ftr element in the document). You dont have to add any elements to the document properties to use this option, but you do need to add the titlePg element to the end of the sectPr element, following the definition of your headers and footers:
My Title Page Header
To ensure that your headers and footers display correctly, you should allocate the space on the page to display them. For this, youll need to control your pages layout, as described earlier in HYPERLINK \l "_Formatting_a_Section" Formatting a Section.
Tables
In WordprocessingML, tables are defined with the tbl element ( HYPERLINK \l "_Table_10:_Table-Related_Elements" Table 10 lists the high-level table elements). The following elements are used within the tbl element:
The tblPr element contains property settings for the table (see HYPERLINK \l "_Table_11:_tblPr_Child Elements (Tab" Table 11). Within the tblPr element, the tblpPr element holds settings that control the tables position (see HYPERLINK \l "_Table_12:_tblpPr_Child Elements (Ta" Table 12).
The tblGrid element contains gridCol elements that define the widths of the columns in the table.
tr elements are used to define the rows for the table. Within the tr element, trPr elements define properties for the row (see HYPERLINK \l "_Table_13:_trPr_Child Elements (Tabl" Table 13).
Within the tr element, tc elements are used to define cells within the row. Within the tc elements, tcPr elements define properties for the cell (see HYPERLINK \l "_Table_14:_tcPr_Child Elements (Tabl" Table 14). Also within the tc elements is the tables content. The content of a tc element can be one or more p elements or even another table.
The following example shows a table with two columns and a single row. The tbl element is followed by a tblPr element, which contains a set of table properties. As is typical in WordprocessingML, each property is an empty element with a single val attribute that contains the value for the property. In this example:
The tblStyle element specifies that the table is to use the TableGrid style (which would have to be defined in the styles element at the top of the document).
The tblW element specifies the total width of the table (in this case, auto).
The tblLook element contains a bitmask that specifies how rows are to be formatted. The hexadecimal value 000001E0 is the result of summing the values for four options: header row formatting, last row formatting, header column formatting, and last column formatting.
The next element inside the tbl element is the tblGrid element, which contains one gridCol element for each column in the table. The w attribute of the gridCol element gives the width of the column in twips. In this example, there are two columns, one 1770 twips and one 1400 twips wide:
With the table now defined, tr elements are added to contain the cells with the tables content. The tr element can contain a trPr element, which holds the properties for the row (for example, the rows height and whether it can be split across a page). The following example omits the trPr element.
Within the tr element, the rows cells, which are defined by tc elements, contain the tables content. Within a tc element, the tcPr element contains the properties for the cell. In the following example:
The tcW elements w attribute specifies that the cell is 1770 units wide.
The type attribute specifies that the unit is twips (dxa).
Also within the tc element is the cells content. In this example, the content is a p element with a single run with a single piece of text:
Hello, World
You can merge cells by using the Vmerge (merge cells vertically) and Hmerge (merge cells horizontally) elements in the tcPr element. An empty Vmerge or Hmerge element with its val attribute set to restart marks the start of a merged range. A Vmerge or Hmerge element without any attributes marks the end of the merged cells. Cells between the first and last merged cell must have a Vmerge or Hmerge element with the val attribute set to continue. In this example, the last cell in the first row starts a merge that is completed in the cell below it:
First cell, first row
Last cell, first row
First cell, second row
Last cell, second row
Figure 9 shows the results of merging the two cells. The space that the second cell of the last row would occupy is now just a continuation of the cell above it and can have no separate content. The content specified in the WordprocessingML file for the second cell of the last row disappears when the WordprocessingML is displayed in Word. The content is still present, though, and can be retrieved through Words object model.
Figure 9. The results of merging two cells
For more information, HYPERLINK \l "_Table_11:_tblPr_Child Elements (Tab" Table 11 lists the table property elements, HYPERLINK \l "_Table_12:_tblpPr_Child Elements (Ta" Table 12 lists the table positioning elements, HYPERLINK \l "_Table_13:_trPr_Child Elements (Tabl" Table 13 lists the child elements for table row properties, and HYPERLINK \l "_Table_14:_tcPr_Child Elements (Tabl" Table 14 lists the child elements for table cell properties.
Document Properties
The document has a set of properties, held in the docPr element. HYPERLINK \l "_Table_9:_docPr_Child Elements (Docu" Table 9 lists the properties that can be set at the document level. Some useful settings for developers who are creating documents include:
view: Controls the view mode in Word. The val attribute of this element can be set to none, print, outline, master-pages, normal, and web. The percent attribute can be used to set the percentage of the zoom.
zoom: Controls how large or small the document appears on the screen in Word. The val attribute of this element can be set to none, full-page, best-fit, text-fit.
documentProtection: Controls whether readers can make unintentional changes to all or part of an online form or document.
footnotePr: This container element holds the property settings and content for all footnotes in the document
endnotePr: This container element holds the property settings and content for endnotes
The following example shows a set of document properties that set the users view to normal, zoom the view to full page, and prevent the user from changing the formatting in the document:
Document Information
The DocumentProperties element performs a different function from the docPr element. Like docPr, DocumentProperties is a container for other elements. The DocumentProperties element, however, is not part of the WordprocessingML namespace but is part of the Common Properties namespace (urn:schemas-microsoft-com:office:office), a set of elements common to all Office applications.
The DocumentProperties element contains meta-information about the document, including the documents title, version, and author. Some statistics about the document are also kept in the DocumentProperties element, including the number of characters, pages, lines, and paragraphs. Heres a sample DocumentProperties element:
Sample Document
Peter Vogel
1
2
15
1
1
11.4920
Section 5: Other Topics
Graphics
WordprocessingML stores graphics as a combination of Vector Markup Language (VML) and a binary representation of the image. A discussion of VML is outside the scope of this document, but this section shows how picture data fits into the structure of a WordprocessingML document.
Some shapes are very easy to add. For instance, to add a rectangle to your document, you only need the VML rect (rectangle) element. The elements style attribute holds the information to draw a rectangle in the right place at the right size:
To use the VML rect element, you must add the Vector Markup Language (VML) namespace (urn:schemas-microsoft-com:vml) to the namespaces declared in your document. The Common Properties namespace (urn:microsoft-schemas:office:office) may also be required if you intend to include anything more than the simplest AutoShapes. Typically, youll establish these namespaces in the documents root element:
Your graphic must appear inside a pict element inside an r element inside a p element. This example uses the VML rect element to add a simple rectangle to the document:
If a graphic consists of more than just a simple shape, you will also need to include a base64-encoded version of the graphic. Considerably more VML is required inside the pict element:
R0lGODlhQQAzAKI
...more base64-encoded data...
q18Ldi1baGzZt1/nZr07dW/Tv0cHDz3cc3HOxzMnt7x8
Bookmarks
Bookmarks are not part of the WordprocessingML namespace but are part of the Annotation Markup Language namespace (http://schemas.microsoft.com/aml/2001/core), which is conventionally prefixed with aml. In a WordprocessingML document, annotation elements, which are empty elements, bracket the area that is bookmarked. An annotation element with its type attribute set to Word.Bookmark.Start marks the start of a bookmark area; an annotation element with its type attribute set to Word.Bookmark.End marks the end of the bookmark.
In this example, a complete paragraph (containing the text Inside bookmark) has been bookmarked with a bookmark called MyBookmark:
Before bookmark
Inside bookmark
After bookmark
If a bookmark is inserted without enclosing any text, the annotation elements will be inserted between r elements:
text sur
rounding bookmark
In addition to the type attribute, which identifies an annotation element as being used as a bookmark, two attributes of the annotation element are used with bookmarks:
The name attribute holds the name of the bookmark and allows you to identify the bookmark.
The id attributes value is what links the ending annotation element for a bookmark to its starting element. In the previous examples, for instance, the id attribute has identical values for the Word.Bookmark.End element and the Word.Bookmark.Start elements.
Fields
A field is, effectively, a kind of declarative programming. A field is a set of instructions on how part of the document is to be processed. Also included in the field definition are any input parameters and the results of the processing.
A typical Word document with several form fields can be seen in Figure 10.
Figure 10. A Word document with several fields to enter
WordprocessingML supports two kinds of fields:
Simple fields: Fields whose instructions are a single unformatted text string.
Complex fields: Fields whose instructions can include more than just a single unformatted text string (for example, references to other fields, or formatted text).
Simple Fields
Simple fields are defined with the fldSimple element. The fldSimple element has an instr (instruction) attribute whose contents define the fields behavior. Within the fldSimple element, an r element holds the results of processing the instructions. For instance, this example creates a simple field that will insert the name of the author from the document properties into the text:
Peter Vogel
Complex Fields
Complex fields appear in WordprocessingML as a series of r elements inside a paragraph. Each r element contains one part of the fields definition. Three r elements contain fldChar elements, which mark the three parts of a complex field definition:
The beginning of the field definition
The end of the field instructions
The end of the field definition
The fldChar element is used to mark each of these three parts. The fldCharType attribute of the fldChar element is set to begin, separate, or end to mark the parts of the field definition. The field instructions are placed in the instrText elements. The instrText elements appear between the r element that marks the beginning of the field definition and the r element that marks the end of the instructions. The results of the fields processing are placed between the r element that marks the end of the instructions and the r element that marks the end of the field definition. For example, form fields require that the definition include a fldData element, which holds binary data required by the field.
To make it easier to find the form field when processing the document, you can add a bookmark to identify the field.
One kind of complex field is a form text field. A set of WordprocessingML elements that creates a single form field inside a p element would look like this:
////
FORMTEXT
Looking at the previous example in detail:
The first r element contains the fldChar element, with its fldCharType attribute set to begin to indicate the start of a field command. For some fields, the fldChar element may be empty. For a form text field, however, the fldData element is required.
For a form text field, the fldData element just needs to be a placeholder, four characters wide (Word will fill in this data when it reads the document). Other fields that use fldData will have different requirements.
The next r element contains the instrText element, which contains the commands that tell Word how to process this field. To create a form text field, the instrText element must contain the text FORMTEXT.
The third r element holds another empty fldChar element with its fldCharType set to separate. This marks the end of the field commands.
The fourth r element contains a t element that holds the result of the fields processing (or the initial value for the field). In this example, five blank spaces have been used as the initial value for the field.
The final r element holds the last fldChar element, this time with its fldCharType attribute set to end to mark the end of the definition.
For Word to process form fields correctly, the document must be protected for form editing only. You can turn on this level of protection by adding a documentProtection element to the docPr element at the start of the WordprocessingML document. The edit attribute of the documentProtection element must be set to forms and the enforcement attribute must be set to on. Heres an example:
After the field has been filled in by the user, the r element that contained the original value will hold the value entered by the user. The result would look like this if the user entered My Data Entered into the form field:
////
FORMTEXT
My Data Entered
Hyperlinks
A hyperlink has two components: the hyperlink itself (the text the user will click) and the target for the link. Potential targets include external files, e-mail addresses, and bookmarks. If you are creating a hyperlink in Microsoft Word, other targets are supported (for example, the top of the document and headings). However, all of those targets are implemented by adding a bookmark at the appropriate location in the document. In this section, youll see how to create a bookmark for a target within the document.
For a bookmark to be the target of a hyperlink, it must be a complete bookmark pair and have a name assigned to it. For instance, in Word if the user creates a hyperlink to the top of the document, a bookmark called _top is inserted at the top of the document. The resulting WordprocessingML looks like this:
The hyperlink that points to this bookmark is represented in WordprocessingML by an hlink element that has _top in its bookmark attribute. The text that is displayed by Word as the hyperlink must be inside a r element between the hlink elements opening and closing element (see Figure 11 for how the link appears in Word):
Go To Top
Figure 11. A hyperlink in Microsoft Word
You can use any style that you want with your hyperlink. However, the Hyperlink style that is generated by Microsoft Word is what most users will recognize as the visual clue for a hyperlink (underlined blue text). For consistencys sake, you should consider adding this style to your document and using it with your hyperlinks:
Two other attributes of the hlink element can be useful in generating a WordprocessingML hyperlink that will be read Word:
screentip: The text in this attribute is displayed when the user rests the mouse pointer on the hyperlink in Word (see Figure 12):
nohistory: This attribute, when set to off, prevents the link from being added to the documents history list when the user clicks it.
Figure 12. A Word hyperlink with a ScreenTip
Macros and Components
A document can also contain Visual Basic for Applications (VBA) code, toolbar modifications, OLE custom controls (OCX) and other active components. All of these items can be represented in WordprocessingML. In this section, youll be introduced to how WordprocessingML stores VBA code and OCX controls. Youll also see how Word ensures that software can detect whether these components are present in the document so that the component can, for instance, be scanned for viruses. Word also ensures that if components are not made visible in WordprocessingML, they will not be executed.
For VBA code, a base64-encoded version of the binary file generated by the VBA editor is held in the binData element inside the docSuppData element. The binData element has a name attribute whose value must be set to editdata.mso. The docSuppData element is a top-level element under the wordDocument root element, and follows the styles element in a document created by Word.
A typical VBA module in a WordprocessingML document looks like this:
QWN0aXZlTWltZQAAAfAEAAAA/////wAAB/AbDwAABA
...more base64-encoded data...
LgBNAFkATQBPAEQAVQBMAEUAAABAAAAL8AQAAAASNFZ4
Representing an OCX control in WordprocessingML is more complicated than storing VBA code because an OCX control also has a graphical representation in the document. For OCX controls, a binData element within a docOleData element is used to hold the OLE data. For OCX controls, the name attribute of the binData element must be set to oledata.mso.
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAA
...more base64-encoded data...
C4zcL+WTKDhJozVltEGRkTOwQAROjpejLDyT5d+/F5BeLt5n3wv4P/Cl4BK=
Later in the document, a set of VML-related elements will handle the display of the component.
Two attributes of the wordDocument element are used to indicate the presence of the VBA code and OCX controls: macrosPresent for VBA code and embeddedObjectPresent for OCX controls.
The macrosPresent attribute is used to indicate that macros are present in the document. If the attribute is missing or if its set to no, Word wont load a document that has a docSuppData element. This attribute is strictly enforced. If, for instance, the attribute is present and is set to yes (indicating that macros are supposed to be present), and Word doesnt find a docSuppData element before it finds the body element, Word will not load the document.
Note Once the document is loaded, Words security settings will control whether the VBA code will be allowed to execute.
The second attribute is the embeddedObjectPresent attribute, which indicates that an OCX control may have been used in the document. If the attribute is missing or if its set to no, Word wont load a document that has a docOleData element. This attribute is not, however, strictly enforced. If the attribute is present and is set to yes, but Word doesnt find a docOleData element before the body element, Word will still load the document.
Section 6: Auxiliary Elements
When a WordprocessingML document is created in Word, a number of elements are included that provide information to any applications used to read the document. These auxHint elements, from the Auxiliary XML Document 2003 namespace (http://schemas.microsoft.com/office/word/2003/auxHint), provide information about how Word handled various elements. Setting the auxHint attributes and elements has no effect on how Word behaves. These elements are provided for the use of other WordprocessingML processing tools and provide a convenient way to access information that would otherwise be difficult to determine.
When you are creating a document, there is no problem with using the WordprocessingML sectPr elements and omitting the auxHint section elements in your document. However, when a WordprocessingML document is read, the sect elements provide containers for the sections of your document. These containers can be very useful to the application that is processing the document, especially when XSL transformations (XSLTs) are used, because XSLTs are oriented towards processing child elements inside container elements.
Sections and Subsections
WordprocessingML does not use a container element for a section but, instead, marks the end of a section with a sectPr element. However, Word does generate sect elements to enclose the p elements that make up a section, creating a true XML container for sections. Within a sect element, each table of contents heading generates sub-section elements that enclose content at a particular heading level or lower.
The sect Element
A WordprocessingML document will consist of at least one sect element. If the document contains multiple sectPr elements, which define multiple sections in the document, the document will consist of a series of sect elements. Including the sect elements in the definition of a WordprocessingML body element, this means that there are three possible structures for the body element:
A single sect element:
...etc. ...
Multiple sect elements:
...etc. ...
...etc. ...
...etc. ...
No sect elements (if the document was generated outside Word):
...etc. ...
The sub-section Element
A sub-section element is generated by Word whenever a paragraph is found that has an outlineLvl element assigned in the p elements pPr element. In this example, for instance, the paragraph is assigned to the third level of the outline (the lowest level is 0):
x
Outline levels are frequently assigned through styles. In Word, the Heading 1 style has an outline level of 0 set in its rPr element. Any text formatted with the Heading 1 style picks up that outline level and generates a sub-section element.
Word nests sub-section elements within each other, depending on the outline level. When Word finds a paragraph with an outlineLvl element assigned to it, Word generates an opening sub-section element. If the outlineLvl element just found is higher than the previous outlineLvl element, the new sub-section element will be nested within the sub-section created for the earlier outlineLvl; if the previous outlineLvl was equal to or higher than the outlineLvl just found, closing elements for all the higher level sub-section elements are generated before the new sub-section element is opened.
In this example, for instance, there are five headings at various heading levels:
Heading Level 1
Paragraph1
Paragraph2
Heading Level 2
Paragraph3
Paragraph4
Heading Level 2
Paragraph5
Paragraph6
Heading Level 1
Paragraph7
Omitting all other WordprocessingML elements, the auxiliary sect and sub-section elements that Word would generate would look like this:
Heading Level 1
Paragraph1
Paragraph2
Heading Level 2
Paragraph3
Paragraph4
Heading Level 2
Paragraph5
Paragraph6
Heading Level 1
Paragraph7
Using the sect and sub-section Elements
Inserting a section break will create a new sect element in the document and close all open sub-section elements. In this sample, a section break has been added after paragraph4:
Heading Level 1
Paragraph1
Paragraph2
Heading Level 2
Paragraph3
Paragraph4
(Section Break(
Heading Level 1
Paragraph5
The resulting sect and sub-section elements would look like this:
Heading Level 1
Paragraph1
Paragraph2
Heading Level 2
Paragraph3
Paragraph4
Heading Level 1
Paragraph5
Auxiliary Attributes of the Tab Element
The tab element takes three attributes from the auxiliary namespace: wTab, tlc, and cTlc. If youre reading a document and need to determine where some text that is positioned on a tab stop will fall horizontally on the page, these properties provide useful information.
In WordprocessingML, the tab element moves the text following it to the next tab stop in the document. The wTab attribute that Word adds to the tab element provides the distance (in twips) between the previous character in the document and the first character of the text at the tab stop. In this example, the word Hello is 2,880 twips from the end of the previous text:
Hello
To get the absolute distance between tab stops, you should reference the settings in the tab elements of the pPr (paragraph properties) element.
The tlc attribute reports on how the space before the tab is filled. Values for this attribute are:
none: No leader line
dot: Dotted leader line
hyphen: Dashed leader line
underscore: Solid leader line
heavy: Heavy solid leader line (appears as middle-dot in Word 2000 and later)
middle-dot: Bullet character leader line
The cTlc attribute states how many dots were used in the leader before the tab stop. Going back to the previous example, the word Hello would have 14 dots between it and the previous text. However, in the example no leader was shown, as indicated by the tlc setting of none.
The Auxiliary font Element
The font element describes the font used by Word for part of the document. In this example, the run is displayed in the Times New Roman font:
Hello, World
You cant use the font element to set which font is usedyou must use the rFont or pFont elements. However, the auxiliary font element is useful when determining what font was used with the text. Without the auxiliary font element, any tool processing a WordprocessingML document would have to determine the documents default font and then check to see if the default font had been overridden by a style or by property settings at the paragraph or run level.
The Auxiliary estimate Attribute
The estimate attribute can appear as an attribute on a number of elements that hold numerical information. Where the estimate attribute appears, it will be set to either true or false and indicates whether Word has estimated the value in the element (true indicates that the value has been estimated).
Reference
Table 1: WordprocessingML Elements
Notes
This table does not contain a complete listing of all WordprocessingML elements but covers the elements that are most likely to be useful to developers. For a complete listing, see the WordprocessingML Schema reference in the Microsoft Office 2003 Reference Schemas.
Note that the child elements of the various property elements (for example, rPr: run properties, pPr: paragraph properties, and so on) appear in separate tables. For auxiliary elements, see HYPERLINK \l "_Table_8:_WordprocessingML_Auxiliary" Table 8.
NameDescriptionfontsA container element containing information about the fonts used in the document. Also contains the defaultFont element, which specifies the default fonts for the document.listsA container element for list definitions and the assignments of a list id to a list definition.listAssociates a list id with a particular list definition.listDefA container element for the definition of a list. See HYPERLINK \l "_Table_15:_listDef_Child Elements (L" Table 15.documentPropertiesA container element for Office-related elements containing information and statistics about the document. docPrA container element for elements that set properties for the document as a whole. See HYPERLINK \l "_Table_9:_docPr_Child Elements (Docu" Table 9. stylesA container element for the styles defined within the document. styleA container element that defines a specific style. Styles are referred to by other elements in the document using the styleId attribute. HYPERLINK \l "_Table_5:_style_Element Attributes" Table 5 lists the attributes of the style element; HYPERLINK \l "_Table_6:_style_Child Elements (Styl" Table 6 lists children of the style element.bodyContains the portion of the document that holds the text that will be displayed to the user. pA paragraph containing one or more runs. rA run of one or more t elements to be displayed with a consistent set of properties. tContains the text to be displayed. pPrContainer for paragraph properties. For the child elements, see HYPERLINK \l "_Table_3:_pPr_Child Elements (Paragr" Table 3. tabsContainer element holding tab elements that define tab stops for a paragraph or style. tabDefines a single tab stop. Attributes are listed in HYPERLINK \l "_Table_7:_tab_Element Attributes" Table 7.brInserts a break between t elements inside an r element. The type attribute controls what kind of break is inserted: page, column, or text-wrapping (the default). tblA container element for a table.tblPrA container element for properties of a table. See HYPERLINK \l "_Table_11:_tblPr_Child Elements (Tab" Table 11.tblpPrA container element for the elements that control the position of a floating table. See HYPERLINK \l "_Table_12:_tblpPr_Child Elements (Ta" Table 12.trA container element for the cells in a table that make up a table row.trPrA container element for the properties of a row in a table. See HYPERLINK \l "_Table_13:_trPr_Child Elements (Tabl" Table 13.tcContains the content for one cell in a table.tcPrA container element for the properties for a cell in a table. See HYPERLINK \l "_Table_14:_tcPr_Child Elements (Tabl" Table 14.sectPrA container element for the definition of the section of the document preceding the sectPr element.ftrContainer element in a sectPr element for the text to be displayed in the page footer.hdrContainer element in a sectPr element for the text to be displayed in the page header. titlePgUsed in the sectPr element to indicate that a separate header and footer for the first page of this section is allowed.docSuppDataContainer for VBA code.binDataChild element of the docSuppData element. The binData element holds the binary representation of the VBA project.
Table 2: rPr Child Elements (Run Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionrStyleCharacter style for this run.String. The character style is set in the styles section.rFontsFonts for this run.String. A font named in the fonts section, or default, fareast, or cs.bSets Latin and Asian characters to bold.on, offb-csSets complex scripts characters to bold.on, offiSets Latin and Asian characters to italic.on, offi-csSets complex scripts characters to italic.on, offcapsFormats lowercase text as capital letters (does not affect numbers, punctuation, non-alphabetic characters, or uppercase letters).on, offsmallcapsFormats lowercase text as capital letters and reduces their size (does not affect numbers, punctuation, non-alphabetic characters, or uppercase letters).on, offstrikeDraws a line through the text.on, offdstrikeDraws a double line through the text.on, offoutlineDisplays the inner and outer borders of each character.on, offshadowAdds a shadow behind the text, beneath and to the right of the text.on, offembossMakes text appear as if it is raised off the page in relief.on, offimprintMakes selected text appear to be imprinted or pressed into page (also referred to as engrave).on, offnoproofFormats the text so that spelling and grammar errors are ignored in this run.on, offsnaptogridSets the number of characters per line to match the number of characters specified in the docGrid element of the current section's properties.on, offvanishPrevents the text in this run from being displayed or printed.on, offwebHiddenPrevents the text in this run from being displayed when this document is saved as a Web page.on, offcolorSpecifies either an automatic color or a hexadecimal color code for this run.3-digit hexBinary
or autospacingThe amount by which the spacing between characters is expanded or condensed.IntegerwStretches or compresses text horizontally as a percentage of its current size.IntegerkernThe smallest font size for which kerning should be automatically adjusted.unsignedIntpositionThe amount by which text should be raised or lowered in relation to the baseline.IntegerszFont size for this Asian and Latin fonts in this run.Integersz-csFont size for complex script fonts in this run.IntegerhighlightHighlights text so it stands out from the surrounding text.on, offuUnderline formatting for this run.underlineValueeffectAnimated text effect for this run.textEffectValuesbdrBorder for characters in this run.borderValuesshdShading for characters in this run.shdValuesfitTextWidth of the space that this run fits into.unsignedIntvertAlignAdjusts the vertical position of the text relative to the baseline and changes the font size if possible (to raise or lower the text without reducing the font size, use the 'Position' element).baseline, superscript, or subscriptrtlSets the alignment and reading order for this run to right-to-left.on, offcsTrue if text in this run is complex scripts text.on, offemSets the type of emphasis mark for this run.none, dot, comma, circle, or under-dothyphenHyphenation style for this run.StringlangLanguages for this run.2-digit hexBinary or a stringasianLayoutSpecial Asian layout formatting properties.See the schema.specVanishProperty that makes text in this run always hidden.on, off
Table 3: pPr Child Elements (Paragraph Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionpStyleParagraph style.String (a style defined in the styles element of the document).keepNextKeep with next paragraph: Prevents a page break between this paragraph and the next.on, offkeepLinesKeep lines together: Prevents a page break in this paragraph.on, offpageBreakBeforeForces a page break before this paragraph.on, offframePrText frame and drop cap properties.FramePrPropertywidowControlPrevents word from printing the last line of a paragraph by itself at the top of the page (widow) or the first line of a paragraph at the bottom of a page (orphan).on, offlistPrList properties.listPrEltsupressLineNumbersPrevents line numbers from appearing next to the paragraph. This setting has no effect in documents or sections with no line numbers.on, offpBdrBorders for the paragraph.pBdrEltshdParagraph shading.ShdValuestabsA container holding a list of tab elements.tabsEltsuppressAutoHyphensPrevents automatic hyphenation.on, offbidiSets the alignment and reading order for a paragraph to right-to-left.on, offadjustRightIndAutomatically adjusts the right indent when you are using the document grid.on, offsnapToGridAligns text to document grid (when defined).on, offspacingSpacing between lines and paragraphs.Two attributes: before, after. Each contains spacing distance in twips.indParagraph indentation.Integer (twips)contextualSpacingDon't add space between paragraphs of the same style.on, offsuppressOverlapDon't allow this frame to overlap.on, offjcParagraph alignment.left, right, center, both, medium-kashida, distribute", "list-tab", "high-kashida", "low-kashida", "thai-distribute"textDirectionOrientation for the paragraph in the current cell, text box, or text frame.lr-tb, tb-rl, bt-lr, lr-tb-v, tb-rl-voutlineLvlOutline level.IntegerdivIdID of HTML DIV element this paragraph is currently in.IntegerrPrRun properties for the paragraph mark.Properties for all r elements within this p elementsectPrSection properties for the section that terminates at this paragraph mark.Contains the properties for the section. Appears in the last paragraph in the section.kinsokuAsian typography: Use East Asian typography and line-breaking rules to determine which characters begin and end a line on a page.on, offwordWrapAsian typography: Allows a line to break in the middle of a Latin word.on, offoverflowPunctAsian typography: Allows punctuation to continue one character beyond the alignment of other lines in the paragraph. If you do not use this option, all lines and punctuation must be perfectly aligned.on, offtopLinePunctAsian typography: Allows punctuation to compress at the start of a line, which lets subsequent characters move in closer.on, offautoSpaceDEAsian typography: Automatically adjusts character spacing between East Asian and Latin text.on, offautoSpaceDNAsian typography: Automatically adjusts character spacing between East Asian text and numbers.on, offtextAlignmentAsian typography: Determines the vertical alignment of all text in a line.top, center, baseline, bottom, auto
Table 4: sectPr Child Elements (Section Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionhdrHeaders that appear at the top page in this section.hdrEltftrFooters that appear at the bottom of the page in this section.ftrEltfootnotePrFootnote properties for this section.ftnEdnPropsEltendnotePrEndnote properties for this section.ftnEdnPropsElttypeSection type.sectTypeEltpgSzSpecifies the size and orientation of this page.pageSzTypepgMarSpecifies the page margins.pageMarTypepaperSrcSpecifies where the paper is located in the printer.paperSourceTypepgBordersSpecifies the page borders.pageBordersTypelnNumTypeSpecifies the line numbering.lineNumberTypepgNumTypeSpecifies the page numbering options.pageNumberTypecolsSpecifies the column properties for this section.columnsTypeformProtTurns form protection on for this section alone.on, offvAlignSets alignment for text vertically between the top and bottom margins.top, center, both, bottomnoEndnoteSuppresses endnotes that would ordinarily appear at the end of this section.on, offtitlePgSpecifies that the first page of this section is different and will have different headers and footers.on, offtextFlowSpecifies text flow.lr-tb, tb-rl, bt-lr, lr-tb-v, tb-rl-vbidiSpecifies that this section contains bidirectional (complex scripts) text.on, offrtlGutterPositions the gutter at the right of the document.on, offdocGridSpecifies the type of document grid."default", "lines", "lines-and-chars", "snap-to-chars"
Table 5: style Element Attributes
AttributeDescriptionValuestypeType of style. paragraph, character, table, liststyleIdName used to refer to this style within XML. Unique within the file. StringdefaultSpecifies whether this style is the default for this type of style.on, off
Table 6: style Child Elements (Style Definitions)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionnamePrimary name of style; built-in style names are converted to a language-independent form.StringaliasesSecondary names of style, separated by commas.StringstiBuilt-in style unique numerical identifier.DecimalNumberPropertybasedOnstyleId (name of style) this style is based on.StringnextstyleId of the next-paragraph style; used only for paragraph styles.StringlinkstyleId of the linked style; used only for linked paragraph and character styles.StringPropertyhiddenDon't show this style to the user.on, offsemiHiddenDon't show this style to the user unless they request to see it.on, offlockedThis style is restricted for use by end user.on, offrsidHexRevision Save Id for this style: a unique identifier used to track when the style was last changed.NumberPropertypPrpParagraph properties for the style, if any.See HYPERLINK \l "_Table_3:_pPr_Child Elements (Paragr" Table 3.rPrCharacter properties for the style, if any.See HYPERLINK \l "_Table_2:_rPr_Child Elements (Run Pr" Table 2.tblPrTable properties.See HYPERLINK \l "_Table_11:_tblPr_Child Elements (Tab" Table 11.trPrTable row properties. See HYPERLINK \l "_Table_13:_trPr_Child Elements (Tabl" Table 13.tcPrTable cell properties. See HYPERLINK \l "_Table_14:_tcPr_Child Elements (Tabl" Table 14.tblStylePrConditional override properties for table styles.tblStylePrElt
Table 7: tab Element Attributes
AttributeDescriptionValuesvalThe type of tab stop.clear, left, right, center, decimal, bar, listleaderHow empty space between tab stops is to be filled.none, dot, hyphen, underscore, heavy, middle-dotposPosition of the tab stop from the left edge, in twips.Integer
Table 8: WordprocessingML Auxiliary Elements and Attributes
NameDescriptionElementssectAn arbitrary section of a WordprocessingML document. The sect element encloses all text between inserted section breaks.sub-sectionA container for all elements at the same heading level. Recursive.fontThe font being used in the paragraph.allowEmptyCollapseHint to transforms to allow this paragraph to autocollapse if empty (for use with HTML).font The font that was actively applied by Word for display use this font for transforms.sym Hint to transforms that this run resolves to a single symbol, described herein.bgcolorThe background color applied at this point.bdrwidthThe HTML equivalent of the border width, in points. This element takes into account different internal border styles and represents the appropriate final presentation width.hintShdPropertyThe HTML equivalent of the background color. This element takes into account various shading settings and represents the appropriate final presentation color.tThe text Word displayed for this object.uiNameThe style name as shown to the user at save time, only exported if different than the name elements value.AttributeswTab Space between start of text at the tab stop and end of previous text.Tlc Type of leader to use before text at a tab stop.cTlcNumber of dots in the leader used.
Table 9: docPr Child Elements (Document Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionvalidateAgainstSchemaTemplates and Add-Ins XML Schema option: Validate document against attached schemas. on, offsaveInvalidXMLTemplates and Add-Ins XML Schema option: Allow saving as XML even if the XML is not valid. on, offignoreMixedContentTemplates and Add-Ins XML Schema option: Save and validate ignores all text not in leaf nodes.on, offalwaysShowPlaceholderTextTurns on display of placeholder text for all empty leaf elements. on, offdoNotUnderlineInvalidXMLTemplates and Add-Ins XML Schema option: Turns off wavy underline of schema violations in document. on, offremoveWordSchemaOnSaveXML Save option: Save data only, removing all elements in the WordprocessingML Schema when saving as XML. on, offuseXSLTWhenSavingXML Save option: Apply a custom transform when saving the document as XML. on, offsaveThroughXSLTXML Save option: The custom transform to apply when saving document as XML. saveThroughXsltEltshowXMLElementsTurns on display of XML elements in document. on, offalwaysMergeEmptyNamespaceControls how empty namespace elements that do not belong to a schema are handled. If set to on, these elements will not be removed. If set to off, they will be removed. on, offhdrShapeDefaultsWrapper for the shape defaults of the headers and footers. shapeDefaultsEltfootnotePrDocument-wide footnote properties, including footnote separators. ftnDocPropsEltendnotePrDocument-wide endnote properties, including endnote separators. ednDocPropsEltcompatContainer for compatibility options (that is, the user preferences entered on the Compatibility tab of the Options dialog in Word).compatEltdocVarsContainer for document variables from documents created in Word version 6.0/95 or earlier. docVarsEltdrawingGridHorizontalSpacingDrawing Grid option: The amount of horizontal space between vertical gridlines. twipsMeasurePropertydrawingGridVerticalSpacingDrawing Grid option: The amount of vertical space between horizontal gridlines. twipsMeasurePropertydisplayHorizontalDrawingGridEveryDrawing Grid option: The amount of space between horizontal gridlines drawn on the screen. decimalNumberPropertydisplayVerticalDrawingGridEveryDrawing Grid option: The amount of space between vertical gridlines drawn on the screen. decimalNumberPropertyuseMarginsForDrawingGridOriginDrawing Grid option: If set to on overrides the settings for drawingGridHorizontalOrigin and drawingGridVerticalOrigin and sets the upper-left corner of the document area within the margins as the grid origin. on, offdrawingGridHorizontalOriginDrawing Grid option: The point at the left edge of the page where you want the invisible grid to begin. This setting is ignored when useMarginsForDrawingGridOrigin is set to on. twipsMeasurePropertydrawingGridVerticalOriginDrawing Grid option: The point at the top edge of the page where you want the invisible grid to begin. This setting is ignored when useMarginsForDrawingGridOrigin is set to on. twipsMeasurePropertydoNotShadeFormDataSpecifies whether to turn off the gray shading on form fields.on, offprintTwoOnOnePage Setup Margins option: For multiple page documents, prints two pages per sheet.on, offpunctuationKerningAsian Typography option: When kerning for Latin text is turned on, also kern punctuation text. on, offcharacterSpacingControlAsian Typography option: Sets the blank-space compression option you want for Asian characters. The equivalent in HTML is setting text-justify-trim on the BODY element. characterSpacingPropertystrictFirstAndLastCharsAsian Typography option: Use standard characters to start and end lines of text. on, offnoLineBreaksAfterAsian Typography option: Specifies which characters are restricted from ending a line.kinsokuPropertynoLineBreaksBeforeAsian Typography option: Specifies which characters are restricted from starting a line. kinsokuPropertywebPageEncodingWeb option: The encoding you want to use when you save as a Web page. stringPropertyoptimizeForBrowserWeb option: Specifies whether to disable features not supported by Web browsers. on, offrelyOnVMLWeb option: Rely on Vector Markup Language (VML) for displaying graphics in browsers. on, offallowPNGWeb option: Allow Portable Network Graphics (PNG ) as a graphic format. on, offdoNotRelyOnCSSWeb option: Turns off cascading style sheets (CSS) for font formatting of Web pages. on, offdoNotSaveWebPagesAsSingleFileWeb option: When saving this file as a Web page, does not save as a single-file Web page (MHTML). on, offdoNotOrganizeInFolderWhen saving as a Web page, causes all supporting files such as bullets, background textures, and graphics to be stored in the same folder as the Web page. on, offdoNotUseLongFileNamesWeb option: Disables long file names of Web pages, forcing a filename of no more than eight characters. on, offpixelsPerInchWeb option: The number of pixels per inch that you want for the display of pictures in Web pages. The size that you select affects the size of graphics relative to the size of text on the screen. decimalNumberPropertytargetScreenSzWeb option: The monitor resolution (screen size) that you are optimizing your Web pages for. The screen size that you specify can affect the size and layout of images on Web pages.targetScreenSzEltsavePreviewPictureDocument Properties Summary option: Saves a picture of the first page of the file for previewing. (This option has no effect the document is saved as XML.) on, offalignBordersAndEdgesPage Border option: Aligns paragraph borders and tables with the page border throughout the document. Setting this element to on eliminates any gaps between adjoining borders. However, Word aligns, or snaps, text to the edge of a table only if the text is one character width (10.5 points) or less from the page border. on, offbordersDontSurroundHeaderPage Border option: Causes the page border to exclude the header. on, offbordersDontSurroundFooterPage Border option: Causes the page border to exclude the footer. on, offgutterAtTopPage Setup Margins option: Positions the gutter at the top of a document. If you have set up your document with facing pages or two pages per sheet (by selecting the Mirror margins, Book fold, or 2 pages per sheet setting for the Multiple Pages list in the Page Setup dialog box), gutterAtTop is ignored.on, offhideSpellingErrorsSpelling and Grammar option: Hides the wavy red line under possible spelling errors in your document. on, offhideGrammaticalErrorsSpelling and Grammar option: Hides the wavy green line under possible grammatical errors in your document. on, offactiveWritingStyleSpelling and Grammar option: The writing style you want Word to use to when checking grammar in this document. writingStylePropertyproofStateThe state of the proofing tools in this document: clean (no errors found) or dirty (errors present in the document).proofPropertyformsDesignSpecifies whether the document is in forms design mode. In this mode, you can edit or create a form by using the ActiveX controls in the Control Toolbox toolbar. on, offattachedTemplateTemplates and Add-Ins option: The template that's attached to this document. stringPropertylinkStylesTemplates and Add-Ins option: Updates the styles in this document to match the styles in the attached template each time you open the document. This ensures that your document contains up-to-date style formatting. on, offstylePaneFormatFilterBitmask of controlling the display of styles in the Styles and Formatting task pane. shortHexNumberPropertydocumentTypeDocument type used by the AutoFormat feature.docTypePropertymailMergeContainer for elements holding mail merge information for this document. mailMergeEltrevisionViewDetermines how document revisions are viewed. trackChangesViewElttrackRevisionsMarks changes in the current document and keeps track of each change by reviewer name. on, offdocumentProtectionProtect Document option: Helps prevent unintentional changes to all or part of an online form or document, as specified. docProtectPropertyautoFormatOverrideProtect Document option: Allows the AutoFormat feature to override formatting restrictions. on, offdefaultTabStopFormat Tabs option: The default spacing between tab stops. twipsMeasurePropertyautoHyphenationLanguage Hyphenation option: Automatically hyphenates the document as you type. on, offconsecutiveHyphenLimitLanguage Hyphenation option: The maximum number of consecutive lines of text that can end with a hyphen. decimalNumberPropertyhyphenationZoneLanguage Hyphenation option: The distance from the right margin within which you want to hyphenate your document. Word hyphenates words that fall into the hyphenation zone. A smaller zone reduces the raggedness of the right margin, but more words may require hyphens. A larger zone increases the raggedness of the right margin, but fewer words may require hyphens. decimalNumberPropertydoNotHyphenateCapsLanguage Hyphenation option: Causes Word to not hyphenate words written in all capital letters. on, offshowEnvelopeDisplays the Microsoft Office Outlook e-mail header in a document. on, offsummaryLengthAutoSummary option: Size for automatic document summary. decimalNumberPropertyclickAndTypeStyleEdit option: Style to be used when automatically formatting paragraphs as a result of double-clicking any open area in the document. docPrStylePropertydefaultTableStyleTable AutoFormat option: Default table style for new documents. docPrStylePropertyevenAndOddHeadersPage Setup Layout option: Creates one header or footer for even-numbered pages and a different header or footer for odd-numbered pages. on, offbookFoldRevPrintingPage Setup Margin option: For multiple-page documents, specifies whether to print the document as a reverse book fold. on, offbookFoldPrintingPage Setup Margin option: For multiple-page documents, specifies whether to print the document as a book fold. on, offbookFoldPrintingSheetsPage Setup Margin option: For multiple-page documents with book fold and reverse book fold printing, sets the number of sheets per booklet. decimalNumberPropertyviewControls the view mode in Word. none, print, outline, master-pages, normal, webzoomControls how large or small the document appears on the screen in Word. none, full-page, best-fit, text-fitremovePersonalInformationIf set to on, helps avoid unintentionally distributing hidden information, such as the document's author or the names associated with comments or tracked changes. on, offdontDisplayPageBoundariesView option: Turns off display of the space between the top of the text and the top edge of the page. on, offdisplayBackgroundShapeView option: Controls display of the background shape in print layout view. on, offprintPostScriptOverTextPrint option: Allows PostScript code in PRINT fields in a document to print on top of the document text instead of underneath it. This elements setting has no effect if a document does not contain PRINT fields. on, offprintFractionalCharacterWidthPrint option: Word for the Macintosh setting that has no effect in other versions of Word. on, offprintFormsDataPrint option: Prints the data entered into an online form without printing the online form. on, offembedTrueTypeFontsSave option: Stores the TrueType fonts used to create this document along with the document. Others who open the document will be able to view and print it with the fonts used to create it, even if those fonts aren't installed on their computer. (NOTE: TrueType fonts are not embedded in XML files.) on, offdoNotEmbedSystemFontsSave option: For the TrueType fonts in you document, does not embed fonts that are likely to already be installed on a computer. This option takes effect only when Embed TrueType fonts option is on. on, offsaveSubsetFontsSave option: For the TrueType fonts in you document, embeds only the font styles you actually used in the document, which may decrease the file size of your document. If you used 32 or fewer characters of a font, Word embeds only those characters. This option takes effect only when Embed TrueType fonts option is on. on, offsaveFormsDataSaves the data entered in an online form as a single, tab-delimited record so you can use it in a database. Word saves the file in Text Only file format. on, offmirrorMarginsPage Setup Margins option: For multiple page documents, swaps left and right margins on facing pages. on, off
Table 10: Table-Related Elements
ElementDescriptiontblIdentifies a table.tblPrContainer for table properties (see HYPERLINK \l "_Table_11:_tblPr_Child Elements (Tab" Table 11).tblGridContainer for column definitions (gridCol element).gridColDefines a columns width in twips; the table will have one column for each gridCol element.trA row in the table.trPrContainer for properties for a row in the table (see HYPERLINK \l "_Table_13:_trPr_Child Elements (Tabl" Table 13).tcA cell within a rowcan contain a paragraph, a tbl element, or a cfChunk element.tcPrContainer for properties for a cell (see HYPERLINK \l "_Table_14:_tcPr_Child Elements (Tabl" Table 14).
Table 11: tblPr Child Elements (Table Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitiontblStyleThe style applied to this table.Name of a table style.tblWPreferred width of the table.IntegerjcTable alignment.left, center, right, both, medium-kashida, distribute, list-tab, high-kashida, low-kashida, thai-distributetblCellSpacingHTML cellspacing attribute for the table (the spacing between individual cells).IntegertblIndWidth that the table should be indented by.IntegertblBordersThe border definitions for the table.tblBordersEltshdTable shading; applies to the cellspacing gaps.shdValuestblLayoutSpecifies whether the table is of fixed width. If not specified, the contents of the table will be taken in to account during layout.FixedtblOverlapShould this table avoid overlapping another table during layout? If this element is not specified, floating tables will be allowed to overlap.NevertblLookWhat aspects of the table styles should be included?Bitmask. 0x0020 (Apply header row formatting)0x0040 (Apply last row formatting)0x0080 (Apply header column formatting)0x0100 (Apply last column formatting)tblpPrTable-positioning properties (for floating tables).tblpPrElt (see HYPERLINK \l "_Table_12:_tblpPr_Child Elements (Ta" Table 12)tblCellMarCell margin defaults for this tables' cells.tblCellMarElttblRtlIs this a right-to-left table? (logical right-to-left, not visual right-to-left). This element is used only to persist settings from Word 9.0/2000 and is not recommended for use. Use bidiVisual instead.on, offbidiVisualIs this not a logical right-to-left table? (visual right-to-left, not logical right-to-left)on, offtblStyleRowBandSizeWhen a style specifies the format for a band for rows in a table (a set of contiguous rows), this specifies The number of rows in a band.Integer
tblStyleColBandSizeWhen a style specifies the format for a band of columns in a table (a set of contiguous rows), this specifies The number of columns in a bandInteger
Table 12: tblpPr Child Elements (Table Positioning Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionleftFromTextDistance between the left table border and the surrounding text (for wrapping tables). IntegerrightFromTextDistance between the right table border and the surrounding text (for wrapping tables). IntegertopFromTextDistance between the top table border and the surrounding text (for wrapping tables). IntegerbottomFromTextDistance between bottom table border and the surrounding text (for wrapping tables). IntegervertAnchorDefines how this table is vertically anchored. text, margin, pagehorzAnchorDefines how this table is horizontally anchored. text, margin, pagetblpXSpecHorizontal alignment (for example, center, left, or right); overrides position set by other formatting options (for example, page layout settings). left, center, right, inside, outsidetblpXHorizontal distance from anchor .IntegertblpYSpecHorizontal alignment (for example, top or bottom); overrides position set by other formatting options (for example, page layout settings). inline, top, center, bottom, inside, outsidetblpYVertical distance from anchor. Integer
Table 13: trPr Child Elements (Table Row Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitiondivIdDefines what HTML DIV element this row belongs within.IntegergridBeforeNumber of grid units consumed before the first cell; assumed to be zero.IntegergridAfterNumber of grid units consumed after the last cell; assumed to be zero.IntegerwBeforePreferred width before the table row.IntegerwAfterPreferred width after the table row.IntegercantSplitIf specified, a page cannot split this row.on, offtrHeightThe height of this row.val attribute: Height it twipsh-rule attribute: exact, at-leasttblHeaderIf specified, this row belongs to the collection of header rows (which will repeat at the top of every page and will get any special header row formatting from the table style). If this row is not contiguously connected with the first row of the table (that is, if either it isn't the first row itself, or all of the rows between this row and the first row are marked as header rows), this property will be ignored.on, off
Table 14: tcPr Child Elements (Table Cell Properties)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitiontcW Preferred width for this cell.Integer gridSpanNumber of grid units this cell consumes -- assumed to be one .IntegerVmergeIs this cell part of (or the beginning of) a vertically merged region? continue, restartHmergeIs this cell part of (or the beginning of) a horizontally merged region? continue, restarttcBordersDefines the borders for this cell. Overrides the definitions given by the table borders. tcBordersEltshdUnderlying shading for this cell. shdValuesnoWrapIf present, specifies that the contents of this cell should never wrap. on, offtcMarMargins for this cell (maps to CSS padding property). Overrides any definitions given in table properties. tcMarElttextFlowDefines the text flow for this cell. "lr-tb": Left To Right; Top to Bottom;
"tb-rl": Top to Bottom; Right to Left;
"bt-lr": Bottom to Top; Left to Right;
"lr-tb-v": Left to Right, Top to Bottom Rotated;
"tb-rl-v": Top to Bottom; Right to Left RotatedtcFitTextCauses text to be sized to fit in cell.on, offvAlignVertical alignment. top, center, both, bottom
Table 15: listDef Child Elements (List Definitions)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionlsidList id.hexNumberPropertypltDescription of the type of list.SingleLevel, MultiLevel, HybridMultiLeveltmplList template for formatting the list. hexNumberPropertynameName of the list definition.StringstyleLinkName of the list style defined in the styles element.StringlistStyleLinkName of the list style that the list is referencing.StringlvlContainer for level properties. A lvl element is required for each level in the list. Includes pPr, tabs, and rPr elements.See HYPERLINK \l "_Table_16:_lvl_Child Elements (List-" Table 16.
Table 16: lvl Child Elements (List-Level Definitions)
Note Some, but not all, of these elements are empty elements with only a val attribute. Where the list of acceptable values for the val attribute is short, those values are given in the Definition column in the following table. However, some elements may take additional attributes besides the val attribute, so you should always consult the WordprocessingML Schema for a full understanding of each element. In some cases, additional notes regarding the element, including its type definition, are also listed in the Definition column.
ElementDescriptionDefinitionstartFirst number in numbering series for the list.IntegernfcSpecifies the number style used for a list.Integer (see HYPERLINK \l "_Table_17:_nfc_Element Integer Value" Table 17)lvlRestartWhen present causes numbering to be restarted at 1.IntegerpStyleName of a style as defined in the styles element.StringisLglIs this level following legal numbering rules? on, offlvlText Text to use as a basis for the number of an item in the list.StringsuffText to follow the number of the item in the list.Tab, Space, NothinglvlPicBulletIdThe number of the built-in graphic to be used as the bullet for an item in the list.IntegerlegacyList level is from Word 6.0/95 or earlier. lvlLegacyEltlvlJcJustification of the actual number. left, center, right, bothpPrThe p element properties. pPrElt (see HYPERLINK \l "_Table_3:_pPr_Child Elements (Paragr" Table 3)rPrThe r element properties.rPrElt (see HYPERLINK \l "_Table_2:_rPr_Child Elements (Run Pr" Table 2)
Table 17: nfc Element Integer Values
Internal name for nfc codeInteger valueDescriptionnfcArabic0Arabic: 1, 2, 3, 4, ...nfcUCRoman1Uppercase roman: I, II, III, IV, ...nfcLCRoman2Lowercase roman: i, ii, iii, iv, ...nfcUCLetter3Uppercase alpha: A, B, C, D, ...nfcLCLetter4Lowercase alpha: a, b, c, d, ...nfcOrdinal5,Ordinal: 1st, 2nd, 3rdnfcCardtext6,Cardinal: One, Two, ThreenfcOrdtext7,Ordinal Text: First, Second, ThirdnfcHex8,Hexadecimal: 8, 9, A, B, C, D, E, F, 10, 11, 12nfcChiManSty9,Chicago Manual of Style: *, , nfcDbNum110Ideograph-digital: N, N, N, V, N, mQ n f c D b N u m 2 1 1 J a p a n e s e c o u n t i n g : N, N, N, V, N, mQ n f c A i u e o 1 2 A i u e o : q, r, s, t, u, v n f c I r o h a 1 3 I r o h a : r, , , , , n f c D b C h a r 1 4 , F u l l - w i d t h A r a b i c : 1 , 2 , 3 , 4 n f c S b C h a r 1 5 , H a l f - w i d t h A r a b i c : 1 , 2 , 3 , 4 n f c D b N u m 3 1 6 J a p a n e s e l e g a l : X, _, S, V,
O, mQ n f c D b N u m 4 1 7 J a p a n e s e d i g i t a l t e n t h o u s a n d : N, N, N, V, N, mQ n f c C i r c l e n u m 1 8 E n c l o s e d c i r c l e s : `$, a$, b$, c$, d$, e$ n f c D A r a b i c 1 9 D e c i m a l f u l l w i d t h 2 : 1 , 2 , 3 , 4 n f c D A i u e o 2 0 A i u e o f u l l w i d t h n f c D I r o h a 2 1 I r o h a f u l l widthnfcArabicLZ22Leading zero: 01, 02, ..., 09, 10, 11, ...nfcBullet23Bullet characternfcGanada24Korean GanadanfcChosung25Korea ChosungnfcGB126Enclosed full stopnfcGB227Enclosed parenthesisnfcGB328Enclosed circle ChinesenfcGB429Ideograph enclosed circlenfcZodiac130Ideograph traditionalnfcZodiac231Ideograph ZodiacnfcZodiac332Ideograph Zodiac traditionalnfcTpeDbNum133Taiwanese countingnfcTpeDbNum234Ideograph legal traditionalnfcTpeDbNum335Taiwanese counting thousandnfcTpeDbNum436Taiwanese digitalnfcChnDbNum137Chinese countingnfcChnDbNum238Chinese legal simplifiednfcChnDbNum339Chinese counting thousandnfcChnDbNum440Chinese (not implemented)nfcKorDbNum141Korean digitalnfcKorDbNum242Korean countingnfcKorDbNum343Korea legalnfcKorDbNum444Korea digital2nfcHebrew145Hebrew-1: , , , , , n f c A r a b i c 1 4 6 A r a b i c a l p h a : # , ( , * , + , , , - n f c H e b r e w 2 4 7 H e b r e w - 2 : , , , , , n f c A r a b i c 2 4 8 A r a b i c a b j a d : #, (, ,, /, G, H n f c H i n d i 1 4 9 H i n d i v o w e l s : , , , , , n f c H i n d i 2 5 0 H i n d i c o n s o n a n t s : , , , , 3 C |
2 3 4 5 6 7 R ѽ~p_ppJ (hVt 5CJ KH OJ QJ aJ mH nH u j h}t UmH nH u j hVt UmH nH u hw! mH nH uhVt mH nH u h" 5j h" 5U h%K hLt CJ aJ h7m CJ aJ h%K h7m CJ aJ h%K h# h`U? 5h%K hAP 5h%K hAP h%K h
7 h4ru h!F huh h
7 5CJ0 aJ0 huh h%/
5CJ0 aJ0 B C |
(
7 q P
!
$
!
a$gd7m
!
!
gdAP H gdrP
!
gd
7 gd!F d 88"gd!F D R S l m n o p q
1 2 K L M N O P w x n jg h}t UmH nH u j h}t UmH nH u jq h}t UmH nH u (hVt 5CJ KH OJ QJ aJ mH nH u j h}t UmH nH u !hVt CJ OJ QJ aJ mH nH u j{ h}t UmH nH u hVt mH nH uj hVt UmH nH u*
9 : ; < = > O P i j k m n o ضإؔr jI h}t UmH nH u j h}t UmH nH u jS h}t UmH nH u j h}t UmH nH u j] h}t UmH nH u !hVt CJ OJ QJ aJ mH nH uhVt mH nH uj hVt UmH nH u j h}t UmH nH u, > o ; q & W
B S z D
!
!
5 6 7 9 : ; Q R k l m o p q x y ױ~m j h}t UmH nH u j5 h}t UmH nH u j h}t UmH nH u j? h}t UmH nH u (hVt 5CJ KH OJ QJ aJ mH nH u j h}t UmH nH u j hVt UmH nH u hVt mH nH u!hVt CJ OJ QJ aJ mH nH u * ! " $ % & 7 8 Q R S U V W j k r j
h}t UmH nH u j
h}t UmH nH u j h}t UmH nH u j! h}t UmH nH u j h}t UmH nH u !hVt CJ OJ QJ aJ mH nH u j+ h}t UmH nH u hVt mH nH uj hVt UmH nH u,
" # < = > @ A B d e ~ j h}t UmH nH u j~ h}t UmH nH u j h}t UmH nH u j h}t UmH nH u j
h}t UmH nH u !hVt CJ OJ QJ aJ mH nH uj hVt UmH nH u hVt mH nH u *
3 4 M N O Q R S Z [ t u v x y z ԲԲԲԲnԲ j` h}t UmH nH u j h}t UmH nH u jj h}t UmH nH u j
h}t UmH nH u !hVt CJ OJ QJ aJ mH nH u jt
h}t UmH nH u j hVt UmH nH u hVt mH nH u(hVt 5CJ KH OJ QJ aJ mH nH u+ $ % > ? @ B C D N O h i j l m n u v ננ~נmנ j h}t UmH nH u jL h}t UmH nH u j h}t UmH nH u !hVt CJ OJ QJ aJ mH nH u jV h}t UmH nH u (hVt 5CJ KH OJ QJ aJ mH nH u j hVt UmH nH u j h}t UmH nH u hVt mH nH u )D n S 3 { ? i L 4 t $ e k
!
!
3 4 M N O Q R S q r ضإؔn j. h}t UmH nH u (hVt 5CJ KH OJ QJ aJ mH nH u j h}t UmH nH u j8 h}t UmH nH u j h}t UmH nH u !hVt CJ OJ QJ aJ mH nH uhVt mH nH uj hVt UmH nH u jB h}t UmH nH u( - . / 1 2 3 [ \ u v w y z { 9 : ; = > ضإؔr j h}t UmH nH u j h}t UmH nH u j h}t UmH nH u j h}t UmH nH u j$ h}t UmH nH u !hVt CJ OJ QJ aJ mH nH uhVt mH nH uj hVt UmH nH u j h}t UmH nH u,> ? I J c d e g h i , - F G H J K L ױ~m jw h}t UmH nH u j h}t UmH nH u j h}t UmH nH u j h}t UmH nH u (hVt 5CJ KH OJ QJ aJ mH nH u j h}t UmH nH u j hVt UmH nH u hVt mH nH u!hVt CJ OJ QJ aJ mH nH u * . / 0 2 3 4 T U n o p r s t " # $ E F _ ` a r jY h}t UmH nH u j h}t UmH nH u jc h}t UmH nH u j h}t UmH nH u jm h}t UmH nH u !hVt CJ OJ QJ aJ mH nH u j h}t UmH nH u hVt mH nH uj hVt UmH nH u,a c d e K L e f g i j k K L e j h}t UmH nH u jE h}t UmH nH u j h}t UmH nH u jO h}t UmH nH u j h}t UmH nH u !hVt CJ OJ QJ aJ mH nH uj hVt UmH nH u hVt mH nH u .k k
! f! ! ! " " " $ Y% % % &