word-documents

Create and modify Word documents programmatically with python-docx code snippets.

186|56|Updated Aug 13, 2025
One-click install
npx skills add https://github.com/aws-samples/sample-strands-agent-with-agentcore --skill word-documents-aws-samples
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: word-documents
Source: https://github.com/aws-samples/sample-strands-agent-with-agentcore/tree/main/chatbot-app/agentcore/skills/word-documents
Command: npx skills add https://github.com/aws-samples/sample-strands-agent-with-agentcore --skill word-documents-aws-samples

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates creating, modifying, previewing, and managing Word (.docx) documents programmatically, removing repetitive manual editing and ensuring consistent professional formatting.

Core Features & Use Cases

  • Programmatic creation and editing: Generate new documents and apply structured content using python-docx code snippets passed to tools like create_word_document and modify_word_document.
  • Preview, read, and manage: Produce page screenshots for visual verification, extract text and comments for review, and list available documents in the workspace.
  • Use Case: An analyst or content creator can assemble quarterly reports with headings, tables, images, and previews, then iterate by modifying the existing file and saving a new version.

Quick Start

Create a new Word document named quarterly-report with a title "Quarterly Report", a Revenue heading, and a short summary paragraph using python-docx code supplied to the create_word_document tool.

Frequently Asked Questions about word-documents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Word document generation programmatically?

Automating Word document generation requires passing python-docx compatible code snippets to tools like create_word_document to programmatically build structured .docx files with headings, tables, and text, ensuring consistent professional formatting without manual editing.

Can I preview a .docx file and extract its comments programmatically?

Previewing a .docx file and extracting comments are supported by generating page screenshots for visual verification and pulling text and comments for review, enabling automated document workflows to inspect content without opening a word processor.

What's the best way to modify an existing Word document in an automated workflow?

Modifying an existing Word document in an automated workflow is best handled by passing python-docx code to the modify_word_document tool to revise content, iterate on the file, and save a new version while ensuring sequential tool execution to avoid file race conditions.

Does python-docx support adding images and tables to Word documents?

python-docx supports adding images and tables to Word documents by supplying structured content through code snippets passed to the document creation and modification tools, allowing analysts to assemble comprehensive reports with varied elements programmatically.

What are the limitations of automating .docx document editing?

Limitations of automating .docx document editing include the requirement to supply document names without extensions, the need to execute tools sequentially to avoid file race conditions, and the dependence on providing valid python-docx compatible code snippets for operations.