Codumentor logo Codumentor

PPTX Editor Plugin

Lets the agent open, edit, and save PowerPoint presentations (.pptx / .pptm) in the conversation — or create one from scratch. Ask it to work on a deck; editing tools appear once a presentation is open, and disappear when it is closed. Saved files show a download card in the transcript (served by the File Links plugin).

Macros in .pptm files are preserved.

Configuration

plugins:
  - module: codumentor.plugins.pptx_editor
    class: PptxEditorPlugin
    args:
      enabled: true
      target_agents: "main"  # "main", "subagent", or "all" (default: "main")

Keep File Links enabled so download cards in the transcript resolve. Without it, save cards still render but their links 404.

Parameters

KeyTypeDefaultDescription
enabledbooltrueMaster switch.
target_agentsstring"main"Which agents get the tools: "main", "subagent", or "all". Any other value is treated as "all".

What the agent can do

pptx_open is always available. After a presentation is open, the editing tools below appear; pptx_close removes them.

The agent can open an existing presentation from a repo, copy it to a new path before editing, or create a new deck at a path that does not exist yet. Maximum file size is 50 MB; embedded images are capped at 20 MB. Search returns at most 200 matches.

ToolWhenDescription
pptx_openalwaysOpen a .pptx/.pptm presentation, or create one (create_new, optional template_path)
pptx_read_outlineopenPer-slide outline: index, title, layout, shape count, notes
pptx_read_slideopenOne slide: shapes (id, type, position, text, tables) and notes
pptx_searchopenRegex search across slide text and notes
pptx_write_textopenReplace a shape's text (preserves run formatting by default)
pptx_write_notesopenWrite or replace speaker notes
pptx_replace_textopenFind/replace across slide text and (optionally) notes
pptx_list_layoutsopenSlide layouts on the active master
pptx_add_slide / pptx_delete_slideopenAdd or remove a slide; add_slide can fill the layout's title and body placeholders in the same call
pptx_move_slide / pptx_duplicate_slideopenReorder or copy a slide
pptx_add_textboxopenAdd a textbox at a given position/size
pptx_add_imageopenEmbed an image from a repo path or base64
pptx_add_shapeopenDraw an auto-shape (rectangle, oval, chevron, …) with optional fill, outline and label
pptx_set_shape_positionopenUpdate a shape's left/top/width/height
pptx_set_text_styleopenFont size, weight, colour, typeface and paragraph alignment on a shape, paragraph or run
pptx_delete_shapeopenRemove a shape by id
pptx_pythonopenEscape hatch: sandboxed python-pptx, no imports (see below)
pptx_saveopenSave; transcript shows a download card
pptx_closeopenClose; refuses over unsaved changes unless save_first or discard_changes

While a presentation is open the agent also receives a short note describing the workflow — save before close, build with layouts rather than coordinates, treat pptx_python as a last resort. It costs nothing in conversations that never open a deck.

Creating a new deck

pptx_open(source_path="repo/decks/overview.pptx", create_new=true) creates the file instead of opening it. The path must not already exist, must end in .pptx or .pptm, and output_path is not allowed alongside create_new.

New decks are 16:9 (12192000 × 6858000 EMU). python-pptx's own default is 4:3, which is not what anyone asks for today.

Pass template_path — a .pptx, .potx or .pptm — to inherit a corporate template's layouts, theme, fonts and slide size; the template's own slides are dropped, so you get the design without the content, and the template's slide size wins over the 16:9 default. This is the right answer to "make it on brand": it beats hand-picked hex colours, which are how branded decks usually go wrong.

Saving

Nothing reaches disk until pptx_save. Every tool that changes the presentation says [unsaved — call pptx_save] in its result while there is unsaved work, and pptx_close refuses to close over it — pass save_first=true to save on the way out, or discard_changes=true to throw the edits away deliberately.

The pptx_python escape hatch

pptx_python runs sandboxed Python against the live Presentation. It is the last resort, not the default route to anything visual — colour, font size, alignment and auto-shapes all have dedicated tools.

It cannot import. The symbols below are pre-loaded in the namespace and are the complete vocabulary available; anything else is unreachable, and the rejection message names this same list back if code tries to import:

prs (the open presentation) · Emu Inches Pt Cm Mm · RGBColor MSO_THEME_COLOR MSO_LINE_DASH_STYLE · MSO_SHAPE MSO_SHAPE_TYPE MSO_CONNECTOR PP_PLACEHOLDER · CategoryChartData XL_CHART_TYPE XL_LEGEND_POSITION · PP_ALIGN MSO_ANCHOR · copy

Also blocked: exec/eval/compile/open/__import__, getattr/setattr/delattr, globals/locals/vars/dir, type/object/super, and all dunder attribute access. Set a top-level result variable to return a value; print() output is streamed back.

To list saved presentations under This conversation in the Files browser, add pptx_save to File Links' tracked_tools. The editor's own download card does not depend on that.

See also