# UserDictionary.Save Method

> 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.

- **Product:** TX Spell .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl.Proofing`
- **Package:** `TXTextControl.TXSpell.WPF.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 WPF > Reference > TXTextControl.Proofing > UserDictionary.Save Method
- **876 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/save-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/save-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/save-method/llms-full.txt

---

### Description

Saves the complete content of the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) in a file at the specified path or as a string array. If using a file name without any file path, the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) 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](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) is not added to the [TXSpell.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/txspell/dictionaries-property/llms-full.txt) or [TXSpellChecker.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/dictionaries-property/llms-full.txt) [DictionaryCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt).

### Syntax

#### Save(string)

Saves the complete content of the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) in a file.

```csharp
public bool Save(string userDictionaryPath);
```

```vbnet
Public Function Save(userDictionaryPath As String) As Boolean
```

| Parameter | Description |
|---|---|
| userDictionaryPath | Specifies a file that is used to save the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt). If the file does not exist, it is created. Otherwise its contents are overwritten. If the path is not valid, an ArgumentException is thrown. |

#### Save(out string\[\])

Saves the complete content of the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) as a string array.

```csharp
public void Save(out string[] stringArray);
```

```vbnet
Public Sub Save(ByRef stringArray As String())
```

| Parameter | Description |
|---|---|
| stringArray | Specifies a string array that is used to save the [user dictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt). |

### Return Value

The method returns true, if the user dictionary could be saved or false if not.

### Examples

The following example saves document content in a specified format.

```csharp
if (userDictionary.Save("document.docx"))
{
    Console.WriteLine("Save completed successfully.");
}
```

```vbnet
If userDictionary.Save("document.docx") Then
    Console.WriteLine("Save completed successfully.")
End If
```

---

## Nearby

- **Previous:** [UserDictionary.RemoveWord Method](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/removeword-method/llms-full.txt)
- **Next:** [UserDictionary.ToArray Method](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/toarray-method/llms-full.txt)
