# Control DOCX export

> Download an edited DOCX, return its bytes, or package related files.



Export the document you have edited, then choose what your application does with the file. The browser Editor
exports DOCX; it does not convert the document to PDF or HTML through this method.

Use the running Editor from the [Quickstart](/editor/quickstart). The examples below belong in your export button's
handler, after `onReady`. Keep the button disabled while export is running and show any rejected promise as an error.

In Vanilla, `superdoc` is the instance you created. In React, obtain it inside the handler before using any example:

```ts
const superdoc = editorRef.current?.getInstance();
if (!superdoc) return;
```

## Download the edited document [#download-the-edited-document]

```ts
await superdoc.export({ exportedName: 'sample-edited' });
```

This starts a download named `sample-edited.docx`. Open it and confirm that your edit is present. The filename does
not need an extension, and DOCX is already the default format.

For a runnable save, edit, restore, and export flow, use the
[version-history example](https://go.superdoc.dev/examples/version-history). Its **Export current DOCX** button downloads
the document currently open in the Editor.

## Return bytes without downloading [#return-bytes-without-downloading]

Set `triggerDownload: false` when your application needs the file instead of a browser download:

```ts
const docx = await superdoc.export({ triggerDownload: false });
```

For one document without additional files, the result is a DOCX `Blob`. Export does not upload it or confirm a save.
Use the [Load and save guide](/editor/load-and-save-documents) to send those bytes to your backend and report success
only after storage confirms the write.

## Check comments and tracked changes [#check-comments-and-tracked-changes]

Export preserves comments by default. The Quickstart's default v2 worker runtime does not support
`commentsType: 'clean'`: export rejects instead of returning a copy without comments.

If you need final text, finish the
[review workflow](/editor/track-changes) before exporting. The v2 Editor does not apply `isFinalDoc`
during export; do not use that option as a review decision.

## Include related files [#include-related-files]

To deliver the DOCX alongside another file, supply a `Blob` and its filename. This example creates its own small
metadata file; it does not require an audit service:

```ts
const metadata = new Blob([JSON.stringify({ document: 'sample-edited' })], { type: 'application/json' });

const bundle = await superdoc.export({
  exportedName: 'sample-edited',
  additionalFiles: [metadata],
  additionalFileNames: ['metadata.json'],
  triggerDownload: false,
});
```

The result is a ZIP `Blob` containing `sample-edited.docx` and `metadata.json`. Keep the two additional-file arrays
in the same order, with one filename for each file. Omit `triggerDownload: false` to download `sample-edited.zip`.

## Choose options for the next export [#choose-options-for-the-next-export]

| Option                                    | Default      | Effect                                                                                |
| ----------------------------------------- | ------------ | ------------------------------------------------------------------------------------- |
| `exportedName`                            | Editor title | Name the DOCX or ZIP without its extension.                                           |
| `triggerDownload`                         | `true`       | Download the result; set it to `false` to return a `Blob` or ZIP without downloading. |
| `commentsType`                            | `'external'` | Preserve comments. The default v2 worker runtime rejects `'clean'`.                   |
| `additionalFiles` / `additionalFileNames` | Empty arrays | Include related files in a ZIP.                                                       |

`exportType` defaults to `['docx']`, the browser Editor's supported export format.
The v2 Editor does not apply `fieldsHighlightColor` during export.

Use [Version history](/editor/version-history) when your application needs to retain each exported DOCX as a saved version.
