如果使用的密码加密算法是“RC4”,本示例将密码加密设置为更强的加密。

With ActiveDocument
    If .PasswordEncryptionAlgorithm = "RC4" Then
        .SetPasswordEncryptionOptions _
        PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
        PasswordEncryptionAlgorithm:="RC4", _
        PasswordEncryptionKeyLength:=56, _
        PasswordEncryptionFileProperties:=True
    End If
End With