# Saved document

The simulator's document as a .docx, with every edit your add-in made, revisions and comments included.

`office.docx()` resolves to the simulator's document as a `.docx` in a `Buffer`. It holds the seed with every edit your add-in has made since, revisions and comments included. That includes edits inside a content control around table rows, which Word's `getOoxml` leaves out. Compare it with what a headless OOXML path makes from the same seed, or keep it as the test's artifact. The simulator serves the same bytes, so a browser test or `curl` reads them without a harness:

```bash
curl -s "$RYSTIC_URL/_rystic/inspect?view=docx" -o redlined.docx
unzip -p redlined.docx word/document.xml | grep -o '<w:ins ' | awk 'END{print NR}'
# -> 3
```

```js
import { writeFileSync } from 'node:fs';

it('redlines the payment clause', async () => {
  await redlineClause('30 days', '45 days');
  writeFileSync('redlined.docx', await office.docx());
});
```

- **Same edits, same file.** Two runs that make the same edits from the same seed save byte-identical files, because the simulator's clock never moves by wall time.
- **It is a whole package.** The file carries the document, its styles, settings, fonts and theme, and `POST /_rystic/seed` takes it back as `state_document.main.docx`.
- **Reading it sends no batch.** `GET /_rystic/inspect?view=docx` adds nothing to the counts `office.stats()` reports.

---

Source: https://www.rystic.ai/docs/simulators/word/features/saved-document · Markdown: https://www.rystic.ai/docs/simulators/word/features/saved-document.md
