Underline ========= Text in a Word document can be underlined in a variety of styles. Protocol -------- The call protocol for underline is overloaded such that it works like ``.bold`` and ``.italic`` for single underline, but also allows an enumerated value to be assigned to specify more sophisticated underlining such as dashed, wavy, and double-underline:: >>> run = paragraph.add_run() >>> run.underline None >>> run.underline = True >>> run.underline True >>> run.underline = WD_UNDERLINE.SINGLE >>> run.underline True >>> run.underline = WD_UNDERLINE.DOUBLE >>> str(run.underline) DOUBLE (3) >>> run.underline = False >>> run.underline False >>> run.underline = WD_UNDERLINE.NONE >>> run.underline False >>> run.underline = None >>> run.underline None Enumerations ------------ * `WdUnderline Enumeration on MSDN`_ .. _WdUnderline Enumeration on MSDN: http://msdn.microsoft.com/en-us/library/office/ff822388(v=office.15).aspx Specimen XML ------------ .. highlight:: xml Baseline run:: underlining determined by inheritance Single underline:: single underlined Double underline:: single underlined Directly-applied no-underline, overrides inherited value:: not underlined Schema excerpt -------------- Note that the ``w:val`` attribute on ``CT_Underline`` is optional. When it is not present no underline appears on the run. .. highlight:: xml ::