# DictionaryCollection.Add Method

> Adds objects of the type Dictionary to the collection and validates them for spell checking and suggestion operations.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl.Proofing`
- **Package:** `TXTextControl.TXSpell.WinForms.SDK` (assembly `TXSpell.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TXSpell.Core.SDK` (assembly `TXSpell.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXSpell.dll` from the setup
- **Path:** TX Spell .NET for Windows Forms > Reference > TXTextControl.Proofing > DictionaryCollection.Add Method
- **568 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/add-method/llms-full.txt

---

### Description

Adds objects of the type [Dictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionary/llms-full.txt) to the [collection](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) and validates them for [spell checking](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/check-method/llms-full.txt) and [suggestion](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/createsuggestions-method/llms-full.txt) operations.

### Syntax

```csharp
public int Add(Dictionary dictionary);
```

```vbnet
Public Function Add(dictionary As Dictionary) As Integer
```

### Parameters

| Parameter | Description |
|---|---|
| dictionary | Specifies the [dictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionary/llms-full.txt). |

### Return Value

The [collection](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) index at which the [dictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionary/llms-full.txt) has been added.

### Examples

The following example adds an item to the dictionary collection.

```csharp
var result = dictionaryCollection.Add(new TXTextControl.Proofing.UserDictionary());
Console.WriteLine($"Add result: {result}");
```

```vbnet
Dim result = dictionaryCollection.Add(New TXTextControl.Proofing.UserDictionary())
Console.WriteLine($"Add result: {result}")
```

### Remarks

This method throws an exception when called while the SpellCheckDialog is open (except for adding dictionaries of type [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) when the built-in options dialog was invoked by a SpellCheckDialog's dialog button).

---

## Nearby

- **Previous:** [DictionaryCollection Class](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt)
- **Next:** [DictionaryCollection.GetItem Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/getitem-method/llms-full.txt)
