WolfDocx - table cell edits

# Update table cells in an existing Word document with Python

Change the approved numbers in a memo's table and leave everything else in the .docx alone. WolfDocx lists the cells it can safely edit, binds each edit to the exact source file and the cell's current text, and writes a new output file only when every edit verifies.

## Update one cell, bound to the source

```
from wolfdocx.reporting import author_report, discover_report_targets, parse_report_request

found = discover_report_targets("board_memo.docx")
revenue = next(
    t for t in found["targets"]
    if t["kind"] == "cell" and t["target"] == {"table": 1, "row": 2, "cell": 2}
)
report = author_report(parse_report_request({
    "source": "board_memo.docx",
    "destination": "board_memo_final.docx",
    "source_sha256": found["source_sha256"],
    "edits": [{**revenue, "text": "7,500"}],
}))
assert report.passed, report.code
```

Table, row, and cell coordinates start at one. `discover_report_targets` returns each editable cell's current text and a structure fingerprint; if the source file or that cell has changed since discovery, `author_report` refuses with a code such as `expected_old_text_mismatch` and writes nothing. One request can carry several cell and text edits, applied together or not at all.

## When to use WolfDocx and when to use python-docx

- Use WolfDocx when the document is a reviewed deliverable and a pipeline may only change specific approved values, with a refusal instead of a partial write when anything is unexpected.
- Use python-docx when you build documents from code or need general read and write access to paragraphs, tables, and styles.

## Limitations

- Discovery lists only cells whose text sits in one simple run.
- Cells that intersect fields, tracked revisions, comments, content controls, or other unsupported inline structures are refused.
- Header and footer tables require naming the exact header or footer part.
- WolfDocx does not lay out pages and makes no general Word compatibility promise.

## Get WolfDocx

WolfDocx Community is MIT-licensed and free, including commercial use. It edits existing .docx files in place in pure Python and does not render pages or convert to PDF. WolfDocx Commercial does not change those rights.

```
pip install wolfdocx
```

WolfDocx Commercial is an organization-scoped subscription. WolfDocx Community installs from public PyPI with pip install wolfdocx. WolfDocx Commercial installs from the authenticated WolfDocx package index with a per-purchase credential, issued on the checkout success page after payment and reissued through https://wolfxl.com/recover.

Review the scoped before-and-after memo files in the [reporting walkthrough](https://wolfsdk.com/blog/updating-existing-office-reporting-files), or [ask about your document](mailto:trial@wolfxl.com?subject=WolfDocx%20workflow%20fit) before purchasing if compatibility is uncertain.

[See WolfDocx Commercial](https://wolfdocx.com/)

### Related tasks

- [Update table cells in an existing Word document with Python](https://wolfdocx.com/update-docx-table-python)
- [Replace text in an existing Word document with Python](https://wolfdocx.com/replace-text-docx-python)
- [Fill a Word template table with rows from Python](https://wolfdocx.com/fill-word-template-python)
- [Word mail merge in Python: fill MERGEFIELD templates and repeating table rows](https://wolfdocx.com/mail-merge-docx-python)
- [Merge Word documents in Python without breaking numbering, headers, or styles](https://wolfdocx.com/merge-docx-python)
- [Update a Word table of contents in Python without opening Word](https://wolfdocx.com/update-toc-docx-python)
- [Convert DOCX to PDF in Python without Word or LibreOffice](https://wolfdocx.com/convert-docx-to-pdf-python)
- [A python-docx alternative for editing existing Word documents](https://wolfdocx.com/python-docx-alternative)
- [How can Python generate many legal contracts from one Word template?](https://wolfdocx.com/generate-contracts-docx-python)
- [Which Python workflow assembles one Word document from clauses and sections?](https://wolfdocx.com/document-assembly-python)
- [How do you prevent Word's unreadable content warning after a python-docx save?](https://wolfdocx.com/python-docx-unreadable-content)
- [Why does python-docx change Link to Previous on headers and footers?](https://wolfdocx.com/python-docx-header-footer-link-to-previous)
- [Can python-docx handle nested tables and complex headers?](https://wolfdocx.com/nested-tables-docx-python)
