Document.SetPasswordEncryptionOptions Method

Sets the options Microsoft Office Word uses for encrypting documents with passwords.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Sub SetPasswordEncryptionOptions ( _
    PasswordEncryptionProvider As String, _
    PasswordEncryptionAlgorithm As String, _
    PasswordEncryptionKeyLength As Integer, _
    ByRef PasswordEncryptionFileProperties As Object _
)
void SetPasswordEncryptionOptions(
    string PasswordEncryptionProvider,
    string PasswordEncryptionAlgorithm,
    int PasswordEncryptionKeyLength,
    ref Object PasswordEncryptionFileProperties
)

Parameters

  • PasswordEncryptionProvider
    Type: System.String
    The name of the encryption provider.
  • PasswordEncryptionAlgorithm
    Type: System.String
    The name of the encryption algorithm. Word supports stream-encrypted algorithms.
  • PasswordEncryptionKeyLength
    Type: System.Int32
    The encryption key length. Must be a multiple of 8, starting at 40.
  • PasswordEncryptionFileProperties
    Type: System.Object%
    true for Word to encrypt file properties. Default is true.

Remarks

For enhanced security, do not use Weak Encryption (XOR) (also called "OfficeXor") or "Office97/2000 Compatible" (also called "OfficeStandard") algorithms.

.NET Framework Security

See Also

Reference

Document Interface

Microsoft.Office.Tools.Word Namespace