# MisspelledWordCollection.Remove Method

> Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document. If text is specified, this text replaces the word's text.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > MisspelledWordCollection.Remove Method
- **931 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/misspelledwordcollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/misspelledwordcollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/misspelledwordcollection/remove-method/llms-full.txt

---

### Description

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document. If text is specified, this text replaces the word's text.

### Syntax

#### Remove(MisspelledWord)

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document.

```csharp
public bool Remove(MisspelledWord misspelledWord);
```

```vbnet
Public Function Remove(misspelledWord As MisspelledWord) As Boolean
```

| Parameter | Description |
|---|---|
| misspelledWord | Specifies the misspelled word to remove. |

#### Remove(MisspelledWord, string)

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.

```csharp
public bool Remove(MisspelledWord misspelledWord, string correctedText);
```

```vbnet
Public Function Remove(misspelledWord As MisspelledWord, correctedText As String) As Boolean
```

| Parameter | Description |
|---|---|
| misspelledWord | Specifies the misspelled word to remove. |
| correctedText | Specifies the corrected text. The current text of the word is replaced with this text. |

### Return Value

The return value is true, if the misspelled word could be removed. Otherwise, it is false.

### Examples

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

```csharp
MisspelledWordCollection misspelledWordCollection = textControl.MisspelledWords;

if (misspelledWordCollection.Count > 0)
{
    MisspelledWord misspelledWord = misspelledWordCollection[1];
    if (misspelledWordCollection.Remove(misspelledWord))
    {
        Console.WriteLine("The item was removed.");
    }
}
```

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

If misspelledWordCollection.Count > 0 Then
    Dim misspelledWord As MisspelledWord = misspelledWordCollection.Item(1)
    If misspelledWordCollection.Remove(misspelledWord) Then
        Console.WriteLine("The item was removed.")
    End If
End If
```

---

## Nearby

- **Previous:** [MisspelledWordCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/misspelledwordcollection/item-property/llms-full.txt)
- **Next:** [MisspelledWordKind Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/misspelledwordkind/enumeration/llms-full.txt)
