Apply Style
apply_styleApply named paragraph or character styles to Word documents targeting specific ranges or search matches, with automatic backup and safe saved changes.
Instructions
Apply a named style. range={start,end} (locations or bare indices) applies a paragraph style to those paragraphs, changing their full look (Heading1-9 auto-created); target={search:{text, occurrence?}} applies a character style to the matched text instead. For an outline level without visual change use set_paragraph_format. Auto-backup (backup=False skips rotation); atomic validated save. Refuses documents open in Word. For batches, use apply_edits. Defining new named styles lives in the academic pack.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | ||
| style | Yes | ||
| backup | No | ||
| target | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||