# LoadSaveSettingsBase.MasterPassword Property

> Specifies a password for the document's access permissions. If the password is an empty string, accessing the document is not restricted. If a password is specified, the access permissions are given through the SaveSettings.DocumentAccessPermissions property.

- **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.MasterPassword Property
- **630 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/masterpassword-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/masterpassword-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/masterpassword-property/llms-full.txt

---

### Description

Specifies a password for the document's access permissions. If the password is an empty string, accessing the document is not restricted. If a password is specified, the access permissions are given through the [SaveSettings.DocumentAccessPermissions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/documentaccesspermissions-property/llms-full.txt) property.

### Syntax

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

```vbnet
Public Property MasterPassword As String
```

### Examples

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

```csharp
loadSaveSettingsBase.MasterPassword = 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.MasterPassword = 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.EmbeddedFiles Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/embeddedfiles-property/llms-full.txt)
- **Next:** [LoadSaveSettingsBase.ReportingMergeBlockFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsavesettingsbase/reportingmergeblockformat-property/llms-full.txt)
