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)
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.StringThe name of the encryption provider.
PasswordEncryptionAlgorithm
Type: System.StringThe name of the encryption algorithm. Word supports stream-encrypted algorithms.
PasswordEncryptionKeyLength
Type: System.Int32The 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
- 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.