Presentation.SetPasswordEncryptionOptions 方法 (PowerPoint)

设置 Microsoft PowerPoint 通过密码加密演示文稿时使用的选项。

语法

expressionSetPasswordEncryptionOptions( _PasswordEncryptionProvider_, _PasswordEncryptionAlgorithm_, _PasswordEncryptionKeyLength_, _PasswordEncryptionFileProperties_ )

表达 一个代表 Presentation 对象的变量。

参数

名称 必需/可选 数据类型 说明
PasswordEncryptionProvider 必需 String 加密提供程序的名称。
PasswordEncryptionAlgorithm 必需 String 加密算法的名称。 PowerPoint 支持流加密算法。
PasswordEncryptionKeyLength 必需 Long 加密密钥长度。 必须是从 40 开始的 8 的倍数。
PasswordEncryptionFileProperties 必需 MsoTriState PowerPoint 进行加密文件属性的 属性值为 msoTrue

备注

PasswordEncryptionFileProperties 参数值可以是下列 MsoTriState 常量之一。

msoFalse
msoTrue

示例

如果未对密码保护的文档的文件属性加密,本示例将设置密码加密选项。

Sub PasswordSettings()

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

End Sub

另请参阅

演示文稿对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。