Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have been working with this lately and thought I would add a bit to the already given answers.</p> <p>To get a list of spelling errors in the document for a certain language, doing the following would get you going:</p> <pre><code>// Set the proofing language myDocument.Content.LanguageID = WdLanguageID.wdDanish; // Get the spelling errors (returns a ProofreadingErrors collection) var errors = myDocument.SpellingErrors; // There is no "ProofreadingError" object -&gt; errors are accessed as Ranges foreach (Range proofreadingError in errors) Console.WriteLine(proofreadingError.Text); </code></pre> <p>As pointed out by Adriano, the key is to specify the language of the document content at first, and then you can access the spelling errors for the given language. I have tested this (Word Interop API version 15, Office 2013), and it works.</p> <p>If you want to get suggestions for each of the misspelled words as well, I suggest you take a look at my previous answer to that issue: <a href="https://stackoverflow.com/a/14202099/700926">https://stackoverflow.com/a/14202099/700926</a></p> <p>In that answer I provide sample code as well as links to relevant documentation for how that is done. In particular, the sample covers how to carry out spell checking of a given word in a certain language (of your choice) using Word Interop. The sample also covers how to access the suggestions returned by Word.</p> <p>Finally, I have a couple of notes:</p> <ul> <li>In contrast to the current accepted answer (your own) - this approach is much faster since it do not have to iterate through each word. I have been working with Word Interop for reports (100+ pages) and trust me, you don't want to sit and wait for that iteration to finish.</li> <li>Information regarding the <code>SpellingErrors</code> property can be found <a href="http://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.word._document.spellingerrors%28v=office.14%29.aspx" rel="nofollow noreferrer">here</a>.</li> <li>Information regarding the non-existence of a <code>ProofreadingError</code> object can be found <a href="http://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.word.proofreadingerrors%28v=office.14%29.aspx" rel="nofollow noreferrer">here</a>.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload