docx.format_text
result = docx.format_text(doc, i, [on=], [all=false], [bold=], [italic=], [underline=], [strike=], [size=], [color=], [font=])
Input: doc, i, on, all, bold, italic, underline, strike, size, color, font · Output: result
What it is
Formats existing text in body paragraph i: the first occurrence of on, every occurrence with all=true, or the whole paragraph when on is omitted. Runs are cut at the edges of the span -- even inside a hyperlink or a tracked insertion -- so the text outside keeps its formatting exactly, and only the properties given change inside it. bold=false switches an inherited bold off. size in points, color #rrggbb.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = docx.format_text(doc, i, [on=], [all=false], [bold=], [italic=], [underline=], [strike=], [size=], [color=], [font=]) | doc —not documented yeti —Formats existing text in body paragraph i: the first occurrence of on, every occurrence with all=true, or the whole paragraph when on is omitted.on optionalFormats existing text in body paragraph i: the first occurrence of on, every occurrence with all=true, or the whole paragraph when on is omitted.all optional (default false)Formats existing text in body paragraph i: the first occurrence of on, every occurrence with all=true, or the whole paragraph when on is omitted.bold optionalbold=false switches an inherited bold off.italic optionalnot documented yetunderline optionalnot documented yetstrike optionalnot documented yetsize optionalsize in points, color #rrggbb.color optionalsize in points, color #rrggbb.font optionalnot documented yet | result — | Returns how many spans were formatted. *Added in v0.4.7* |
Examples
No documentation example calls this form yet. The File I/O chapter is where one belongs.