pptx_add_text_box
Add a text box to a PowerPoint slide with custom position and size, and optionally set font properties like size, bold, italic, font name, and color.
Instructions
Add a text box with optional font properties to a slide.
The text box is appended to the slide's shape list and its
0-based index within that slide is returned (VAL-PPTX-031).
When font_size / bold / italic / font_name /
color are given, they are applied to the text box's first
run (VAL-PPTX-032); when any of them is None the
corresponding attribute is left at the layout / default value.
Args:
path: Path to an existing .pptx.
text: Text to put inside the text box.
x: Left edge in inches (e.g. 1.0).
y: Top edge in inches (e.g. 2.0).
w: Width in inches (e.g. 3.0).
h: Height in inches (e.g. 0.5).
slide: 0-based slide index (VAL-PPTX-034).
folder: Optional base folder for relative paths.
font_size: Optional font size in points (VAL-PPTX-032).
bold: Optional bold flag (VAL-PPTX-032).
italic: Optional italic flag.
font_name: Optional font name (e.g. "Arial").
color: Optional hex color string ("FF0000").
Returns:
{"shape_index": <int>} — 0-based index of the new
text box within the slide's shape list.
Raises:
OfficeMCPError: ERR_INVALID_PARAMS for non-numeric or
out-of-range geometry, out-of-range slide, or invalid
color; ERR_FILE_NOT_FOUND if the file is missing;
ERR_UNSUPPORTED_FMT for non-.pptx extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| text | Yes | ||
| x | Yes | ||
| y | Yes | ||
| w | Yes | ||
| h | Yes | ||
| slide | No | ||
| folder | No | ||
| font_size | No | ||
| bold | No | ||
| italic | No | ||
| font_name | No | ||
| color | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||