Document.PasswordEncryptionFileProperties 屬性 (Word)

True 是表示 如果 Microsoft Word 要加密以密碼保護之文件的檔案內容。 唯讀的 Boolean

語法

expressionPasswordEncryptionFileProperties

一個代表 文件 物件的變數。

註解

若要指定 Word 是否要加密密碼保護之文件的檔案屬性使用 SetPasswordEncryptionOptions 方法。

範例

如果未將以密碼保護之文件的檔案內容加密,則本範例會設定密碼加密選項。

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

另請參閱

Document 物件

支援和意見反應

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