word_format_run
Update formatting of a specific text run in a Word document by paragraph and run index. Set bold, italic, font size, font name, or color individually.
Instructions
Update the formatting of a single run.
Args:
path: Path to an existing .docx.
paragraph_index: Zero-based index of the paragraph.
run_index: Zero-based index of the run inside that paragraph.
bold: True / False to set, or None to leave as-is.
italic: Same convention as bold.
font_size: Point size (int or float) or None.
font_name: Font name string or None.
color: Hex color string (e.g. "FF0000") or None.
folder: Optional base folder for relative paths.
Returns:
{"ok": True}.
Special case:
If all of bold, italic, font_size, font_name,
color are None, the function is a no-op: the file is
not re-saved and the SHA256 is preserved
(VAL-WORD-039 / VAL-WORD-076).
Raises:
OfficeMCPError: ERR_INVALID_PARAMS if indices are out of
range or of the wrong type, or color is not a valid
hex string. ERR_FILE_NOT_FOUND if the file is missing,
ERR_UNSUPPORTED_FMT for non-.docx extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| paragraph_index | Yes | ||
| run_index | Yes | ||
| bold | No | ||
| italic | No | ||
| font_size | No | ||
| font_name | No | ||
| color | No | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||