# UserDictionary Constructor

> Initializes a new instance of the UserDictionary class.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **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 > UserDictionary Constructor
- **869 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/constructor/llms-full.txt

---

### Description

Initializes a new instance of the [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) class.

### Syntax

#### UserDictionary()

Creates an empty instance of the [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) class.

```csharp
public UserDictionary();
```

```vbnet
Public Sub New()
```

#### UserDictionary(string)

Initializes a new instance of the [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) class by loading a specific user dictionary file.

```csharp
public UserDictionary(string userDictionaryPath);
```

```vbnet
Public Sub New(userDictionaryPath As String)
```

| Parameter | Description |
|---|---|
| userDictionaryPath | Specifies the path of the user dictionary file. Using the dictionary name without any file path, the corresponding dictionary file in the default dictionary folder is used. The name of the specified user dictionary file must end with ".txd". If the file does not exist, or if it is not valid, an ArgumentException is thrown. |

#### UserDictionary(string\[\], CultureInfo)

Initializes a new instance of the [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) class by loading a string array that represents the content of a user dictionary file.

```csharp
public UserDictionary(string[] dictionaryLines, CultureInfo language);
```

```vbnet
Public Sub New(dictionaryLines As String(), language As CultureInfo)
```

| Parameter | Description |
|---|---|
| dictionaryLines | The string array that represents the content of a user dictionary file. Each string of the array IS considered as a line of the dictionary file. |
| language | Specifies the [language](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionary/language-property/llms-full.txt) of the dictionary. |

### Examples

The following example creates an User Dictionary instance and configures its is editable setting for a document workflow.

```csharp
TXTextControl.Proofing.UserDictionary userDictionary = new();
userDictionary.IsEditable = true;
```

```vbnet
Dim userDictionary As New TXTextControl.Proofing.UserDictionary()
userDictionary.IsEditable = True
```

---

## Nearby

- **Previous:** [UserDictionary.AddWord Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/addword-method/llms-full.txt)
- **Next:** [UserDictionary.FilePath Property](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/filepath-property/llms-full.txt)
