# Reorder a Word Document and Add a Clickable Contents Page

> Moves sections of a Word document into the order you specify without touching their formatting, and builds a clickable contents page at the front.

Reorder a Word Document and Add a Clickable Contents Page is a paid AI agent skill on Agensi by siyu liu, in Productivity. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $2 (one-time purchase)
- Creator: [siyu liu](https://www.agensi.io/creators/siyu-liu)
- Category: [Productivity](https://www.agensi.io/skills/productivity)
- Version: 1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/reorder-a-word-document-and-add-a-clickable-contents-page
- Tags: productivity, technical-documentation

## What it does

- Reorders sections without rewriting or reformatting the text
- Keeps images, tables and bullet numbering intact
- Generates a clickable contents page from internal bookmarks
- Refuses to save if any original paragraph would be lost
- Validates the XML order Word requires
- Can derive a draft outline from existing heading styles

## About this skill

Reordering a report by hand loses formatting: fonts drift, images detach, numbering restarts. This skill moves the original paragraph elements instead of rewriting them, so every run, image, table and bullet keeps the formatting it already had.

It works in three steps. First it dumps the document as an indexed list of paragraphs with their styles, so you can see exactly which range belongs to which section. Then you write the target outline as a small JSON spec, mapping each heading to a range of paragraph indexes. Then it rebuilds the document, inserts the headings where they are missing, and generates a clickable contents page at the front.

The contents page uses internal bookmarks rather than a Word contents field, so the links still work when the file moves to another machine. Page numbers use a field that Word recalculates when the document opens.

Before saving, it checks that every original paragraph is covered exactly once, so content cannot be silently dropped, and it validates the XML element order that Word is strict about.

## Requires

- Python 3.x
- python-docx and lxml

## Known limitations

You supply the target outline as a JSON spec; it does not guess your intended order unless you use the auto-outline mode. Page numbers refresh in Word, or with a select-all and F9. Contents links are bookmarks, not a Word table-of-contents field.

## Technical details

One Python script using python-docx and lxml. Operates on word/document.xml, moving the original paragraph elements rather than regenerating them. Takes a JSON spec with source, destination and an ordered list of headings with paragraph ranges. Contains a schema-order self-check on paragraph and run properties, and an abort if the ranges leave any paragraph uncovered.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Reorder a Word Document and Add a Clickable Contents Page skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does Reorder a Word Document and Add a Clickable Contents Page do?

Moves sections of a Word document into the order you specify without touching their formatting, and builds a clickable contents page at the front.

### Which AI agents support Reorder a Word Document and Add a Clickable Contents Page?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Reorder a Word Document and Add a Clickable Contents Page?

Connect your AI agent to Agensi through MCP, then ask it to use Reorder a Word Document and Add a Clickable Contents Page on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
