DocumentBase.PasswordEncryptionFileProperties 属性

获取一个值,用于指示 Microsoft Office Word 是否对受密码保护的文档的文件属性进行加密。

命名空间:  Microsoft.Office.Tools.Word
程序集:  Microsoft.Office.Tools.Word.v4.0.Utilities(在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

语法

声明
Public ReadOnly Property PasswordEncryptionFileProperties As Boolean
public bool PasswordEncryptionFileProperties { get; }

属性值

类型:System.Boolean
如果 Microsoft Office Word 对受密码保护的文档的文件属性进行加密,则为 true;否则为 false。

备注

使用 SetPasswordEncryptionOptions 方法指定 Word 是否对受密码保护的文档的文件属性进行加密。

示例

下面的代码示例在未对受密码保护的文档的文件属性进行加密时设置密码加密选项。 若要使用此示例,请从文档级项目内的 ThisDocument 类中运行此示例。

Private Sub DocumentPasswordEncryptionFileProperties()
    If Me.PasswordEncryptionFileProperties = False Then
        Dim PasswordEncryptionProvider As String = _
            "Microsoft RSA SChannel Cryptographic Provider"
        Dim PasswordEncryptionAlgorithm As String = "RC4"
        Dim PasswordEncryptionKeyLength As Integer = 56
        Dim PasswordEncryptionFileProperties As Object = True

        Me.SetPasswordEncryptionOptions(PasswordEncryptionProvider, PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength, PasswordEncryptionFileProperties)
    End If
End Sub 
private void DocumentPasswordEncryptionFileProperties()
{
    if (this.PasswordEncryptionFileProperties == false)
    {
        string PasswordEncryptionProvider = "Microsoft RSA SChannel Cryptographic Provider";
        string PasswordEncryptionAlgorithm = "RC4";
        int PasswordEncryptionKeyLength = 56;
        object PasswordEncryptionFileProperties = true;

        this.SetPasswordEncryptionOptions(PasswordEncryptionProvider,
            PasswordEncryptionAlgorithm, PasswordEncryptionKeyLength,
            ref PasswordEncryptionFileProperties);
    }
}

.NET Framework 安全性

请参见

参考

DocumentBase 类

Microsoft.Office.Tools.Word 命名空间