Expand Minimize

Document.SetPasswordEncryptionOptions Method

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

Namespace:  Microsoft.Office.Tools.Word
Assemblies:   Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

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.

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft