> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/docx-generation-failure-spellstart.md).

# DOCX Generation Failure: SpellStart, GramStart, or GramEnd

Fix DOCX generation failures caused by Microsoft Word spelling and grammar markup inside the uploaded template.

This error usually means Microsoft Word saved proofing markup inside the `.docx` file.

S-Docs cannot process Word spelling and grammar markers during DOCX generation.

### Common error messages

You may see one of these errors:

* `Failed to parse XML due to: could not determine namespace bound to attribute prefix w`
* `spellStart`
* `gramStart`
* `gramEnd`

These errors point to the same root cause.

Word added spelling or grammar suggestion markup to the template file.

### Why this happens

When Word flags text with red or blue underlines, it can store extra XML tags in the file.

That markup can include proofing attributes such as `w:spellStart`, `w:gramStart`, or `w:gramEnd`.

If those tags remain in the uploaded template, DOCX generation can fail.

### Fix the DOCX template

{% stepper %}
{% step %}

### Open the template record

Go to the S-Docs template that is failing.
{% endstep %}

{% step %}

### Download the latest uploaded DOCX

Open **Template Editor**.

Select **Download most recently uploaded DOCX**.
{% endstep %}

{% step %}

### Open the file in Microsoft Word

Use Word to review the document for spelling and grammar markup.
{% endstep %}

{% step %}

### Clear all proofing suggestions

Remove or resolve every spelling and grammar suggestion in the file.

Make sure all red and blue underlines are gone.

{% hint style="warning" %}
Some proofing marks disappear, then new ones appear. Keep reviewing until all suggestions are cleared.
{% endhint %}
{% endstep %}

{% step %}

### Save the cleaned DOCX file

Save the file after all proofing markup is removed.
{% endstep %}

{% step %}

### Re-upload the DOCX file

Return to the template.

Use **Choose File** to upload the cleaned version.
{% endstep %}

{% step %}

### Generate the document again

Test the template with a real record.

If the proofing markup was the issue, generation should now succeed.
{% endstep %}
{% endstepper %}

### Quick check

Before you re-upload, confirm:

* no red spelling underlines remain
* no blue grammar underlines remain
* the saved file is still a `.docx`

### Related articles

* [Microsoft Word (DOCX)](https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs.md)
* [Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-microsoft-templates-docx-pptx-xlsx.md)


---

# 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://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/docx-generation-failure-spellstart.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.
