Document.PasswordEncryptionFileProperties Property (2007 System)
Gets a value that indicates whether Microsoft Office Word encrypts file properties for password-protected documents.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property PasswordEncryptionFileProperties As Boolean
'Usage
Dim instance As Document
Dim value As Boolean
value = instance.PasswordEncryptionFileProperties
[BrowsableAttribute(false)]
public bool PasswordEncryptionFileProperties { get; }
[BrowsableAttribute(false)]
public:
property bool PasswordEncryptionFileProperties {
bool get ();
}
public function get PasswordEncryptionFileProperties () : boolean
Property Value
Type: System.Boolean
true if Microsoft Office Word encrypts file properties for password-protected documents; otherwise, false.
Remarks
Use the SetPasswordEncryptionOptions method to specify whether Word encrypts file properties for password-protected documents.
Examples
The following code example sets the password encryption options if the file properties are not encrypted for password-protected documents.
This example is for a document-level customization.
Private Sub DocumentPasswordEncryptionFileProperties()
If Me.PasswordEncryptionFileProperties = False Then
Dim PasswordEncryptionProvider As String = _
"Microsoft RSA SChannel Cryptographic Provider"
Dim PasswordEncryptionAlgorithm As String = "RC4"
Dim PasswordEncryptionKeyLength As Integer = 56
Dim PasswordEncryptionFileProperties As Object = True
Me.SetPasswordEncryptionOptions(PasswordEncryptionProvider, PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, PasswordEncryptionFileProperties)
End If
End Sub
private void DocumentPasswordEncryptionFileProperties()
{
if (this.PasswordEncryptionFileProperties == false)
{
string PasswordEncryptionProvider = "Microsoft RSA SChannel Cryptographic Provider";
string PasswordEncryptionAlgorithm = "RC4";
int PasswordEncryptionKeyLength = 56;
object PasswordEncryptionFileProperties = true;
this.SetPasswordEncryptionOptions(PasswordEncryptionProvider,
PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength,
ref PasswordEncryptionFileProperties);
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.