共用方式為


Presentation.SetPasswordEncryptionOptions 方法 (PowerPoint)

會設定 Microsoft PowerPoint 用來以密碼加密簡報的選項。

語法

expressionSetPasswordEncryptionOptions( _PasswordEncryptionProvider_, _PasswordEncryptionAlgorithm_, _PasswordEncryptionKeyLength_, _PasswordEncryptionFileProperties_ )

表達 代表 Presentation 物件的變數。

參數

名稱 必要/選用 資料類型 描述
PasswordEncryptionProvider 必要 String 加密提供者的名稱。
PasswordEncryptionAlgorithm 必要 String 加密演算法的名稱。 PowerPoint 支援資料流加密演算法。
PasswordEncryptionKeyLength 必要 Long 加密金鑰長度。 它必須是 8 的倍數,從 40 開始。
PasswordEncryptionFileProperties 必要 MsoTriState msoTrue ,PowerPoint 會加密檔案屬性。

註解

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

另請參閱

Presentation 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應