Skip to content

Add enhanced Word, Excel and PowerPoint tools#3

Merged
patniko merged 2 commits intomainfrom
new-tools
Feb 6, 2026
Merged

Add enhanced Word, Excel and PowerPoint tools#3
patniko merged 2 commits intomainfrom
new-tools

Conversation

@patniko
Copy link
Owner

@patniko patniko commented Feb 6, 2026

Word Tools (Phase 1 - Parity with PowerPoint):

  • get_document_overview: structural scan with headings, word count, tables
  • get_selection_text: plain text selection (not raw OOXML)
  • insert_content_at_selection: surgical HTML insert at cursor
  • find_and_replace: search/replace with case and whole-word options

Word Tools (Phase 2 - Enhanced):

  • get_document_section: read content by heading name
  • insert_table: insert formatted table with header/striped styles
  • apply_style_to_selection: format text (bold, italic, font, color, highlight)

PowerPoint Tools (Phase 3 - Refinement):

  • get_slide_notes: read speaker notes
  • set_slide_notes: add/update speaker notes
  • duplicate_slide: copy existing slide

Total: 10 new tools to improve Word/PowerPoint capabilities

Word Tools (Phase 1 - Parity with PowerPoint):
- get_document_overview: structural scan with headings, word count, tables
- get_selection_text: plain text selection (not raw OOXML)
- insert_content_at_selection: surgical HTML insert at cursor
- find_and_replace: search/replace with case and whole-word options

Word Tools (Phase 2 - Enhanced):
- get_document_section: read content by heading name
- insert_table: insert formatted table with header/striped styles
- apply_style_to_selection: format text (bold, italic, font, color, highlight)

PowerPoint Tools (Phase 3 - Refinement):
- get_slide_notes: read speaker notes
- set_slide_notes: add/update speaker notes
- duplicate_slide: copy existing slide

Total: 10 new tools to improve Word/PowerPoint capabilities
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83958eb434

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +117 to +119
range.expandTo(endPara.getRange(Word.RangeLocation.whole));

const html = range.getHtml();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use expanded range when extracting section HTML

The section reader builds a range from startPara and calls expandTo, but then it reads HTML from the original range object instead of the expanded one. In Word JS, expandTo returns a new range, so this currently returns only the first paragraph/heading rather than the whole section, which breaks the core behavior of get_document_section for multi-paragraph sections.

Useful? React with 👍 / 👎.

Comment on lines +54 to +58
// Due to API limitations, we provide feedback about the limitation
// In a full implementation, this would use Office.context.document.setSelectedDataAsync
// or OOXML manipulation for notes

return `Note: Setting slide notes via the web add-in API has limitations. For slide ${slideIndex + 1}, please use the Notes pane in PowerPoint to add: "${notes.substring(0, 100)}${notes.length > 100 ? "..." : ""}"`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Persist notes instead of returning an instructional message

This tool never writes to slide notes: after validating the index, it immediately returns a message telling the user to edit notes manually. That makes set_slide_notes a no-op even on successful calls, so callers will believe notes were updated when no presentation state changed.

Useful? React with 👍 / 👎.

Comment on lines +115 to +121
if (targetIndex !== undefined && targetIndex !== slideCount) {
// Reload slides to get updated order
slides.load("items");
await context.sync();

// Find and move the new slide
// Note: Moving slides requires specific API support

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor targetIndex when duplicating slides

When targetIndex is provided, the code enters a branch that only reloads slides and leaves a TODO comment, but never repositions the new slide. The response still reports the duplicate at targetIndex + 1, so callers get incorrect placement and misleading success output whenever a non-default target is requested.

Useful? React with 👍 / 👎.

Comment on lines +95 to +100
// Copy text shapes (basic duplication - full OOXML copy would be more complete)
for (const shape of sourceSlide.shapes.items) {
try {
const text = shape.textFrame?.textRange?.text;
if (text) {
newSlide.shapes.addTextBox(text, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Copy non-text shapes when duplicating a slide

The duplication logic recreates only text boxes (addTextBox) from shapes that expose text and drops everything else (images, charts, tables, lines, formatting/layout metadata). For typical slides this produces a materially incomplete duplicate while the tool advertises full duplication, so users can lose most slide content.

Useful? React with 👍 / 👎.

New Excel tools:
- get_workbook_overview: structural scan with sheets, used ranges, named ranges, charts
- find_and_replace_cells: search/replace text in cells with case/whole-cell options
- insert_chart: create charts (column, bar, line, pie, area, scatter, doughnut)
- apply_cell_formatting: format cells (bold, colors, borders, number format, alignment)
- create_named_range: define named ranges for easier reference

Total new tools: 5 Excel + 10 Word/PowerPoint = 15 new tools
@patniko patniko changed the title Add enhanced Word and PowerPoint tools Add enhanced Word, Excel and PowerPoint tools Feb 6, 2026
@patniko patniko merged commit 73fb64a into main Feb 6, 2026
3 checks passed
@patniko patniko deleted the new-tools branch February 6, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant