docx

Automates creating, reading, editing, and formatting Word (.docx) files using Python scripts and supporting tools like defusedxml and lxml for parsing, modifying, reassembling them; extracts content and reorganizes documents with headings, tables, images, tracked changes, and comments.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/gaos6e/MyOpenclaw --skill docx-gaos6e
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/gaos6e/MyOpenclaw/tree/main/skills/docx
Command: npx skills add https://github.com/gaos6e/MyOpenclaw --skill docx-gaos6e

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, lxml, and includes scripts (resource) components.

What problem does it solve?

Word documents (.docx) often require repetitive formatting, image insertion, and content updates, which are time-consuming and error-prone. This Skill provides an integrated workflow to create, read, edit, and format DOCX files reliably.

Core Features & Use Cases

  • Create new documents from templates or content blocks with headings, styles, tables, and images.
  • Edit existing DOCX files: modify text, reflow content, insert images, tables, and sections, and manage tracked changes or comments.
  • Extract content and restructure Word documents for reporting, templating, or conversion to other formats.

Quick Start

Create a Word document with the requested content, apply formatting, and insert images and tables as needed.

Frequently Asked Questions about docx

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

FAQPage Schema
How do I automate Word document editing and formatting in Python?

To automate Word document editing, this Skill unpacks .docx files, parses the XML using lxml, modifies content like headings, tables, and images, and repacks them into valid DOCX files reliably.

How do I create a Word document from a template with tables and images?

Creating a Word document from templates is handled by applying content blocks to existing structures, inserting images and tables, and reassembling the DOCX file through Python scripts.

Does this approach support managing tracked changes and comments in DOCX files?

Yes, managing tracked changes and comments in DOCX files is supported, allowing you to read, add, or modify revisions directly within the XML structure before repacking the document.

Can I extract and reorganize content from existing Word documents?

Yes, you can extract and reorganize content from Word documents by unpacking the .docx file, parsing the internal XML to pull specific text or sections, and restructuring it for reporting or conversion.

Do I need defusedxml and lxml to parse and modify DOCX files?

Yes, defusedxml and lxml are required dependencies to safely parse and manipulate the underlying XML structure of DOCX files during the unpack, edit, and pack workflow.

What are the limitations of unpacking and repacking Word documents manually?

Unpacking and repacking Word documents requires maintaining strict XML structural integrity; any malformed elements during content reflow or image insertion can corrupt the final DOCX file output.