More on Styles
Having come this far in the chapter, you should already know a few key aspects of how styles work in Word and WordprocessingML:
A style is a grouping of property settings that can be applied as a unit.
There are four kinds of styles: paragraph, character, table, and list.
Styles are defined using
w:styleelements inside a WordprocessingML document’s
Paragraphs, runs, and tables can be directly associated with a style of the appropriate kind through the
You should also know the basic syntax of the
w:style element, and four aspects in particular:
w:typeattribute, indicating the type of style defined here (
w:defaultattribute, indicating whether this style is the default style for its type
w:styleIdattribute for intra-document references to this style
w:nameelement, indicating the style’s primary name as exposed in the Word UI
In this section, we’ll look at a few more aspects of how styles are defined, how default styles work (or don’t), how to derive styles, and how style conflicts are resolved.
A Document’s Styles
All styles that are used within a document must also be defined in the document. This effectively means that you can’t leverage Word’s built-in styles outside of Word; i.e., you can’t simply refer to them by name. When a document uses a built-in Word style, Word makes a copy of the built-in style, rather than merely a reference ...