# MisspelledWordCollection.GetEnumerator Method

> Returns an enumerator that can be used to iterate through the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > MisspelledWordCollection.GetEnumerator Method
- **474 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/misspelledwordcollection/getenumerator-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/misspelledwordcollection/getenumerator-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/misspelledwordcollection/getenumerator-method/llms-full.txt

---

### Description

Returns an enumerator that can be used to iterate through the collection.

### Syntax

```csharp
public MisspelledWordCollection.MisspelledWordEnumerator GetEnumerator();
```

```vbnet
Public Function GetEnumerator() As MisspelledWordCollection.MisspelledWordEnumerator
```

### Return Value

The return value is an IEnumerator that represents the collection.

### Examples

The following example works with misspelled words in the current document by using `MisspelledWordCollection.GetEnumerator`.

```csharp
MisspelledWordCollection misspelledWordCollection = textControl.MisspelledWords;

IEnumerator enumerator = misspelledWordCollection.GetEnumerator();

while (enumerator.MoveNext())
{
    MisspelledWord misspelledWord = (MisspelledWord)enumerator.Current;
    Console.WriteLine(misspelledWord);
}
```

```vbnet
Dim misspelledWordCollection As MisspelledWordCollection = textControl.MisspelledWords

Dim enumerator As IEnumerator = misspelledWordCollection.GetEnumerator()

While enumerator.MoveNext()
    Dim misspelledWord As MisspelledWord =
        DirectCast(enumerator.Current, MisspelledWord)
    Console.WriteLine(misspelledWord)
End While
```

---

## Nearby

- **Previous:** [MisspelledWordCollection.GetCount Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/misspelledwordcollection/getcount-method/llms-full.txt)
- **Next:** [MisspelledWordCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/misspelledwordcollection/getitem-method/llms-full.txt)
