Document.SetPasswordEncryptionOptions 方法

設定 Microsoft Office Word 以密碼加密文件時使用的選項。

命名空間:  Microsoft.Office.Tools.Word
組件:   Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)
  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
Sub SetPasswordEncryptionOptions ( _
    PasswordEncryptionProvider As String, _
    PasswordEncryptionAlgorithm As String, _
    PasswordEncryptionKeyLength As Integer, _
    ByRef PasswordEncryptionFileProperties As Object _
)
void SetPasswordEncryptionOptions(
    string PasswordEncryptionProvider,
    string PasswordEncryptionAlgorithm,
    int PasswordEncryptionKeyLength,
    ref Object PasswordEncryptionFileProperties
)

參數

  • PasswordEncryptionProvider
    型別:System.String
    加密提供者的名稱。
  • PasswordEncryptionAlgorithm
    型別:System.String
    加密演算法的名稱。Word 支援資料流加密演算法。
  • PasswordEncryptionKeyLength
    型別:System.Int32
    加密金鑰長度。必須是 8 的倍數,從 40 起算。
  • PasswordEncryptionFileProperties
    型別:System.Object%
    true 表示 Word 加密檔案屬性。預設為 true。

備註

若要加強安全,請勿使用 Weak Encryption (XOR) (也稱為 "OfficeXor") 或 "Office97/2000 Compatible" (也稱為 "OfficeStandard") 演算法。

.NET Framework 安全性

請參閱

參考

Document 介面

Microsoft.Office.Tools.Word 命名空間