返回一个 Long 类型的数值,它表示 Microsoft Word 用密码加密文档时所用的密码键长。只读。
expression.PasswordEncryptionKeyLength
expression 必需。该表达式返回“应用于”列表中的一个对象。
使用 SetPasswordEncryptionOptions方法指定 Microsoft Word 用密码加密文档时所用的密码键长。
如果密码加密键长小于 40,则本示例将设置密码加密选项。
Sub PasswordSettings()
With ActiveDocument
If .PasswordEncryptionKeyLength < 40 Then
.SetPasswordEncryptionOptions _
PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
PasswordEncryptionAlgorithm:="RC4", _
PasswordEncryptionKeyLength:=56, _
PasswordEncryptionFileProperties:=True
End If
End With
End Sub