# LoadSaveSettingsBase.UserPassword Property

> Specifies the password for the user when the document is reopened. If the password is an empty string the document can be reopened by every user.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 11.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 for Windows Forms > Reference > TXTextControl > LoadSaveSettingsBase.UserPassword Property
- **586 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/userpassword-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/userpassword-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/userpassword-property/llms-full.txt

---

### Description

Specifies the password for the user when the document is reopened. If the password is an empty string the document can be reopened by every user.

### Syntax

```csharp
public string UserPassword { get; set; }
```

```vbnet
Public Property UserPassword As String
```

### Examples

The following example supplies a document-open password obtained from secure application configuration. The configured base settings are then used by the appropriate load or save operation.

```csharp
loadSaveSettingsBase.UserPassword = documentPassword;
if (loadSaveSettingsBase is LoadSettings loadSettings)
{
    textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);
}
else if (loadSaveSettingsBase is SaveSettings saveSettings)
{
    textControl.Save("configured-document.docx", StreamType.WordprocessingML, saveSettings);
}
```

```vbnet
loadSaveSettingsBase.UserPassword = documentPassword
If TypeOf loadSaveSettingsBase Is LoadSettings Then
    textControl.Load("template.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, LoadSettings))
ElseIf TypeOf loadSaveSettingsBase Is SaveSettings Then
    textControl.Save("configured-document.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, SaveSettings))
End If
```

### Limitations

PDF only. The encryption key length is 128 bits.

---

## Nearby

- **Previous:** [LoadSaveSettingsBase.ReportingMergeBlockFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/reportingmergeblockformat-property/llms-full.txt)
- **Next:** [LoadSettings Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/llms-full.txt)
