Word) (Document.PasswordEncryptionAlgorithm 屬性
會傳回指出 Microsoft Word 用於以密碼加密文件的演算法的 字串 。 唯讀。
語法
expression。 PasswordEncryptionAlgorithm
表達 代表 Document 物件的變數。
註解
若要指定 Word 用於以密碼加密文件的演算法使用 SetPasswordEncryptionOptions 方法。
範例
如果使用中的密碼加密演算法是 "OfficeXor" (此為 Word 97 for Windows 之前的 Word 版本所用的密碼演算法),本範例會設定密碼加密選項。
Sub PasswordSettings()
With ActiveDocument
If .PasswordEncryptionAlgorithm = "OfficeXor" Then
.SetPasswordEncryptionOptions _
PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
PasswordEncryptionAlgorithm:="RC4", _
PasswordEncryptionKeyLength:=56, _
PasswordEncryptionFileProperties:=True
End If
End With
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應