---
title: "Check Word document accessibility in C#"
url: https://recursiveai.org/onedocument/cookbook/check-word-document-accessibility/
description: "Check a Word DOCX for accessibility issues in C#. Find pictures with missing alt text and report their document locations without installing Word."
version: "1.0.0"
---

# Check Word document accessibility in C#

**OneDocument** is a free, open-source Word, Excel and PowerPoint document library for .NET from Recursive AI. MIT or Apache-2.0, no native dependencies.

[NuGet](https://www.nuget.org/packages/RecursiveAI.OneDocument.Documents) · [GitHub](https://github.com/recursive-ai-oss/onedocument-csharp) · [Docs](https://recursiveai.org/onedocument/docs/) · [Download example (.zip)](https://recursiveai.org/onedocument/cookbook/check-word-document-accessibility/check-word-document-accessibility.zip)

Check `route.docx` from the zip for missing alt text (image descriptions).

```shell
dotnet add package RecursiveAI.OneDocument.Documents
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported.

```csharp
using RecursiveAI.OneDocument.Documents;

using var doc = Document.Open("route.docx");
var report = doc.CheckAccessibility();
foreach (var issue in report.ForRule(
    "alt-text.missing"))
{
    Console.WriteLine(issue.ObjectName);
    Console.WriteLine(issue.Location.Description);
}
```

Prints:

```text
Picture 1
body, paragraph 3, run 1
```

Unzip [the example](https://recursiveai.org/onedocument/cookbook/check-word-document-accessibility/check-word-document-accessibility.zip), then `dotnet run`.

The checker also looks at table headers, heading structure, link text, and some text contrast cases. `report.Issues` lists all findings, not just missing alt text.

## The full program

The sample contains the heading “Route map” and a blue path from Depot to Park, with no alt text. The download prints the rule ID alongside the picture name. Use the paragraph and run (a piece of content within a paragraph) to locate the picture, especially when several pictures have generic names.

```csharp
using RecursiveAI.OneDocument.Documents;

using var doc = Document.Open("route.docx");
var report = doc.CheckAccessibility();
foreach (var issue in report.ForRule("alt-text.missing"))
{
    Console.WriteLine($"{issue.RuleId}: {issue.ObjectName}");
    Console.WriteLine(issue.Location.Description);
}
```

`dotnet run` prints:

```text
alt-text.missing: Picture 1
body, paragraph 3, run 1
```

The check reads the document and doesn’t edit it. If the main XML part is damaged, the check can raise `OfficeFormatException` instead of returning findings.

## Variations

**Read the suggested fix.** In the snippet at the top, replace the two `Console.WriteLine` calls inside the loop with:

```csharp
Console.WriteLine(issue.Suggestion);
```

```text
Describe what the picture shows or says, or mark it as decorative if it adds no information.
```

## Related recipes

- [Insert an image in a Word document](https://recursiveai.org/onedocument/cookbook/insert-image-in-word-document/)
- [Set Word document properties](https://recursiveai.org/onedocument/cookbook/set-office-custom-document-properties/)
- [Add a table to a Word document](https://recursiveai.org/onedocument/cookbook/add-table-to-word/)

---

## The short answer

Use `Document.CheckAccessibility()` to check a Word DOCX in C#. Filter the report with `ForRule("alt-text.missing")` to find images without alt text. Each finding identifies the object by name when available and reports its location in the document. No Word installation or automation is required.

## How do I check a Word document for accessibility issues?

Each issue has a category and a suggested action. The Word location includes the story (body, header, footer, footnotes or endnotes) and, where available, the paragraph and run. Paragraphs are counted from 1 in document order, including paragraphs in table cells.

Separate findings from checks that could not be made. `report.Skipped` records those checks and their reasons; for instance, a drawing part that can’t be parsed. OneDocument implements rules from published Office guidance, but the [accessibility docs](https://recursiveai.org/onedocument/docs/accessibility/) don’t claim identical results. As [Section508.gov explains](https://www.section508.gov/blog/accessibility-bytes/use-document-accessibility-checkers/), automated checks can miss issues or flag false positives. An empty findings list doesn’t establish that the DOCX is accessible.

## What does “missing alt text” mean in a Word document?

The picture has neither alternative text nor a decorative marker. For a picture that conveys information, write a description that gives the reader what they need in context. In this sample, “Blue path from Depot to Park” conveys more than the generic name “Picture 1.” If a picture really serves only as decoration, mark it as decorative instead. Don’t mark an informative image as decorative just to clear a finding.

The checker can tell you that a description is missing; it can’t decide what a useful description should say. Read the text alongside the image and ask what a reader who can’t see it would miss. Check the DOCX again after you make changes, and review the meaning of the text by hand.
