Share via


Document.SpellingErrors, propriété (System 2007)

Mise à jour : novembre 2007

Obtient une collection ProofreadingErrors qui représente les mots identifiés comme mal orthographiés dans le document.

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word.v9.0 (dans Microsoft.Office.Tools.Word.v9.0.dll)

Syntaxe

<BrowsableAttribute(False)> _
Public ReadOnly Property SpellingErrors As ProofreadingErrors

Dim instance As Document
Dim value As ProofreadingErrors

value = instance.SpellingErrors
[BrowsableAttribute(false)]
public ProofreadingErrors SpellingErrors { get; }

Valeur de propriété

Type : Microsoft.Office.Interop.Word.ProofreadingErrors

Collection ProofreadingErrors qui représente les mots identifiés comme mal orthographiés dans le document.

Exemples

L'exemple de code suivant insère un mot mal orthographié dans le document, puis vérifie l'orthographe de tous les mots dans le document.

Cet exemple illustre une personnalisation au niveau du document.

Private Sub DocumentSpellingErrors()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This bookmark contains a spellling error."

    Dim IgnoreUppercase As Object = True
    Dim AlwaysSuggest As Object = True
    If Me.SpellingErrors.Count > 0 Then
        Me.CheckSpelling(, IgnoreUppercase, AlwaysSuggest)
    End If
End Sub 
private void DocumentSpellingErrors()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This bookmark contains a spellling error.";

    object IgnoreUppercase = true;
    object AlwaysSuggest = true;
    if (this.SpellingErrors.Count > 0)
    {
        this.CheckSpelling(ref missing, ref IgnoreUppercase, ref AlwaysSuggest,
            ref missing, ref missing, ref missing, ref missing,
            ref missing, ref missing, ref missing, ref missing,
            ref missing);
    }
}

Autorisations

Voir aussi

Référence

Document, classe

Membres Document

Microsoft.Office.Tools.Word, espace de noms