Workbook.SetPasswordEncryptionOptions(Object, Object, Object, Object) 方法

定义

设置使用密码加密工作簿的选项。

public void SetPasswordEncryptionOptions (object PasswordEncryptionProvider, object PasswordEncryptionAlgorithm, object PasswordEncryptionKeyLength, object PasswordEncryptionFileProperties);

参数

PasswordEncryptionProvider
Object

加密提供程序的字符串,区分大小写。

PasswordEncryptionAlgorithm
Object

算法短名称(例如“RC4”)的区分大小写的字符串。

PasswordEncryptionKeyLength
Object

加密密钥长度,为 8 的倍数(40 或更大)。

PasswordEncryptionFileProperties
Object

如果为 true(默认值),则加密文件属性。

注解

PasswordEncryptionProviderPasswordEncryptionAlgorithmPasswordEncryptionKeyLength 参数不是相互独立的。 选定的加密提供程序限制了可以选择的算法集和密钥长度。

对于 PasswordEncryptionKeyLength 参数,密钥长度范围没有内在限制。 范围由加密服务提供程序确定,该提供程序还确定加密算法。

可选参数

有关可选参数的信息,请参阅Office 解决方案中的可选参数

适用于