# DOCX Generation Failure: SpellStart, GramStart, or GramEnd

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)](/sdocs/template-architecture/document-formats/docx-s-docs.md)
* [Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)](/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-microsoft-templates-docx-pptx-xlsx.md)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/document-formats/docx-s-docs/additional-resources/docx-generation-failure-spellstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
