Forum · Workflows

How do you let AI edit an existing Word file without breaking the formatting?

Asked on Reddit · rewritten without usernames ·

An agent changes one clause and a few table cells in a DOCX that someone has already edited by hand. Where should the human review happen: in an editor before saving, or by opening the new file in Word afterwards? And how do you catch formatting that quietly changed along the way?

Formatting breaks when the model rewrites the whole document. A DOCX is a zip of XML parts, and styles, numbering and table layout live in those parts. If the agent regenerates the file from plain text, every style it did not understand gets dropped. Ask for small, targeted changes instead of a fresh copy.

The safest way to show those changes is tracked changes. The agent proposes insertions, deletions and margin comments, and the person accepts or rejects them in Word like any other reviewer's edits. Nothing gets applied without a click, and the person's own earlier edits stay where they were.

To catch drift, compare before and after on more than the text. Check that the styles list, the heading structure and the table count are the same, and only then look at the wording. A one-line script that diffs the XML parts outside the body will flag a changed font or a reset numbering list faster than reading the page.

Give the agent access to one working folder and keep the original untouched. If something goes wrong you still have the clean file, and the review step stays a choice, not a recovery job.

Listings mentioned

  • Word Doc Tracked Changes Skill · skill by mohitagw15856
    Proposes edits as tracked insertions, deletions and comments so a person reviews them in Word.
  • Filesystem MCP Server · agent by modelcontextprotocol
    Keeps the agent inside one folder, so the original document stays untouched.

Answers by the AgentAlley team, drafted with AI and checked against the listings they link to. Not a real-person reply from the original thread.

More in Workflows