# UserDictionary Class

> The UserDictionary class represents a dictionary that allows to use, create and edit user dictionaries. The first constructor creates an empty UserDictionary object with no reference to a file. The second constructor initializes a new UserDictionary object that is filled with the content of a specified word list file. As with all dictionaries of type Dictionary, the content of the dictionary is only accessed when the dictionary was added to the TXSpell.Dictionaries collection. The third constructor loads a dictionary from string arrays that represent the content of an user dictionary. It is recommended to create that array by using the encoding that was used to create the source of that dictionary. Using that implementation, it is required to define the language of the dictionary through the System.Globalization.CultureInfo language parameter that sets the user dictionary's Language property automatically. To declare a specific encoding for the dictionary, use the Dictionary.DictionaryEncoding property. If the encoding is not declared through the property or inside the word list file, the encoding of operation system's current ANSI code page is used. The UserDictionary class is inherited from the abstract class Dictionary.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `TXTextControl.Proofing.Dictionary`
- **Path:** TX Spell .NET for Windows Forms > Reference > TXTextControl.Proofing > UserDictionary Class
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/#description)
- [Syntax](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/#syntax)
- [Examples](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/#examples)
- [Members](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/#members)

---

## In This Section

- [UserDictionary.AddWord Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/addword-method/llms.txt): Adds a word to the user dictionary. The method has no effect, if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.
- [UserDictionary Constructor](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/constructor/llms.txt): Initializes a new instance of the UserDictionary class.
- [UserDictionary.FilePath Property](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/filepath-property/llms.txt): Gets the name and path of the file that has been used to load this user dictionary or where it has been saved to. If the user dictionary was neither loaded from nor saved as a file, the property returns null.
- [UserDictionary.IsEditable Property](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/iseditable-property/llms.txt): Gets or sets a value indicating whether the user dictionary is editable or not. The default value is true.
- [UserDictionary.RemoveAllWords Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/removeallwords-method/llms.txt): Removes all words from the user dictionary. The method has no effect, if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.
- [UserDictionary.RemoveWord Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/removeword-method/llms.txt): Removes a word the user dictionary. The method has no effect if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.
- [UserDictionary.Save Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/save-method/llms.txt): Saves the complete content of the user dictionary in a file at the specified path or as a string array. If using a file name without any file path, the user dictionary is saved in the default dictionary folder. The method has no effect, if the specified path does not end with ".txd" or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.
- [UserDictionary.ToArray Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/toarray-method/llms.txt): Converts all user dictionary entries to a string array.

---

## Nearby

- **Previous:** [TXSpellChecker.UserDictionaryWordRemoved Event](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/userdictionarywordremoved-event/llms.txt)
- **Next:** [UserDictionary.AddWord Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/addword-method/llms.txt)
