UserPassword Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
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
public string UserPassword { get; set; }Public Property UserPassword As StringExamples
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.
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);
}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 IfLimitations
PDF only. The encryption key length is 128 bits.