> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/docx-editor/docx-editor-initial-edit-mode.md).

# Set initial edit mode in Apryse DOCX Editor

Learn how to set the initial edit mode in the Apryse DOCX Editor using WebViewer and JavaScript. Control editing behavior when documents first load.

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="https://apryse.com/capabilities#DOCXEditor" class="button primary">Package: DOCX Editor</a><a href="https://showcase.apryse.com/office-editor" class="button primary">Live demo</a>
{% endhint %}

The [DOCX Editor](/web/docx-editor/docx-editor.md) supports multiple edit modes that determine how users can interact with a document.

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-8be4935149790c60d242ed26eeeee05af6876a07%2F94c4fab090aa5f93a68c92463b16a725debb6dcd-1024x505.png?alt=media)

You can choose from the following modes:

* **Editing** – full editing capabilities are enabled.
* **Reviewing** – users can suggest and review tracked changes.
* **Viewing** – the document cannot be edited.

The `initialEditMode` property allows you to specify the default edit mode when a document is loaded. This property is part of the `officeEditorOptions` object, which is included in the `WebViewerOptions` parameter passed to the `WebViewer` function.

This may be added to the WebViewer options to set the `initialEditMode` as demonstrated below.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  ...,
  initialDoc: 'https://myserver.com/myfile.docx',
  initialMode: Webviewer.Modes.DOCX_EDITOR,
  officeEditorOptions: {
    initialEditMode: WebViewer.InitialEditModes.EDITING, // Default edit mode
    // initialEditMode: WebViewer.InitialEditModes.REVIEWING, // Enables tracked change editing
    // initialEditMode: WebViewer.InitialEditModes.VIEW_ONLY', // Enables viewing without document editing
    // initialEditMode: WebViewer.InitialEditModes.PREVIEW', // Enables view only with accepted tracked changes preview
  },
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

[Enable DOCX editing](/web/docx-editor/edit-docx-file.md) [WebViewerOptions](https://sdk.apryse.com/api/web/global.html#WebViewerOptions) [InitialEditModes](https://sdk.apryse.com/api/web/global.html#InitialEditModes)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/web/docx-editor/docx-editor-initial-edit-mode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
