DocumentBase.Permission 属性

定义

获取一个表示文档的权限设置的 Permission

public Microsoft.Office.Core.Permission Permission { get; }

属性值

Permission

一个表示文档的权限设置的 Permission

示例

下面的代码示例检查是否为文档启用了权限,并显示一条显示结果的消息。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

private void DocumentPermission()
{
    if (!this.Permission.Enabled)
    {
        MessageBox.Show("Permissions are not enabled on "
            + "the current document.");
    }
}
Private Sub DocumentPermission()
    If Not Me.Permission.Enabled Then
        MessageBox.Show("Permissions are not enabled on " & "the current document.")
    End If
End Sub 

适用于