# Office Word

> Read and write Microsoft Word (.docx) files. Use when the user asks to read, analyze, create, or convert Word documents.

- Skill: `aws-samples/office-word` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add aws-samples/office-word`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aws-samples/office-word/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: aws-samples (https://skillmd.com/u/aws-samples)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aws-samples/office-word

---


## Read a Word file

Converts a `.docx` to Markdown:

```bash
uv run --with python-docx ~/.kiro/skills/office-word/scripts/read_docx.py "<path_to_docx>"
```

Save as `.md` file:

```bash
uv run --with python-docx ~/.kiro/skills/office-word/scripts/read_docx.py "<path_to_docx>" "<output.md>"
```

## Write a Word file

### Preferred: Directly from markdown content (no intermediate file)

Pipe markdown content directly into the script using `--stdin`:

```bash
echo '<markdown_content>' | uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py --stdin "<output.docx>"
```

For multi-line content, use a heredoc:

```bash
uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py --stdin "<output.docx>" <<'EOF'
# Title

Some paragraph with **bold** text.
EOF
```

### From an existing Markdown file

If a `.md` file already exists, use it directly:

```bash
uv run --with python-docx ~/.kiro/skills/office-word/scripts/write_docx.py "<input.md>" "<output.docx>"
```

If you had to create the `.md` file as an intermediate step (it didn't exist before), delete it after generating the docx.

### Workflow to create a Word document

1. Prefer piping content via `--stdin` to avoid intermediate files.
2. If content is too large for a heredoc, create a temporary `.md` file, convert, then delete it.

## Supported formatting

- Headings (H1-H4), bullet lists, numbered lists, tables
- Bold, italic, and bold-italic inline formatting
- Tables are converted bidirectionally between Markdown and Word Table Grid style

