Character Style =============== Word allows a set of run-level properties to be given a name. The set of properties is called a *character style*. All the settings may be applied to a run in a single action by setting the style of the run. Protocol -------- There are two call protocols related to character style: getting and setting the character style of a run, and specifying a style when creating a run. Get run style:: >>> run = p.add_run() >>> run.style >>> run.style.name 'Default Paragraph Font' Set run style using character style name:: >>> run.style = 'Emphasis' >>> run.style.name 'Emphasis' Set run style using character style object:: >>> run.style = document.styles['Strong'] >>> run.style.name 'Strong' Assigning |None| to :attr:`.Run.style` causes any applied character style to be removed. A run without a character style inherits the default character style of the document:: >>> run.style = None >>> run.style.name 'Default Paragraph Font' Specifying the style of a run on creation:: >>> run = p.add_run(style='Strong') >>> run.style.name 'Strong' Specimen XML ------------ .. highlight:: xml A baseline regular run:: This is a regular paragraph. Adding `Emphasis` character style:: This paragraph appears in Emphasis character style. A style that appears in the Word user interface (UI) with one or more spaces in its name, such as "Subtle Emphasis", will generally have a style ID with those spaces removed. In this example, "Subtle Emphasis" becomes "SubtleEmphasis":: a few words in Subtle Emphasis style Schema excerpt -------------- .. highlight:: xml ::