Document.PasswordEncryptionProvider Property (2007 System)

Gets the name of the algorithm encryption provider that Microsoft Office Word uses when encrypting documents with passwords.

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 PasswordEncryptionProvider As String
'Usage
Dim instance As Document 
Dim value As String 

value = instance.PasswordEncryptionProvider
[BrowsableAttribute(false)]
public string PasswordEncryptionProvider { get; }
[BrowsableAttribute(false)]
public:
property String^ PasswordEncryptionProvider {
    String^ get ();
}
public function get PasswordEncryptionProvider () : String

Property Value

Type: System.String
The name of the algorithm encryption provider that Microsoft Office Word uses when encrypting documents with passwords.

Remarks

Use the SetPasswordEncryptionOptions method to specify the name of the algorithm encryption provider that Word uses when encrypting documents with passwords.

Examples

The following code example sets the password encryption options if the password encryption algorithm in use is not "Microsoft RSA SChannel Cryptographic Provider."

This example is for a document-level customization.

Private Sub DocumentPasswordEncryptionProvider()
    If Me.PasswordEncryptionProvider <> "Microsoft RSA SChannel Cryptographic Provider" 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 DocumentPasswordEncryptionProvider()
{
    if (this.PasswordEncryptionProvider != "Microsoft RSA SChannel Cryptographic Provider")
    {
        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

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace