Share via


WorkbookBase.Permission 属性

定义

获取一个 Microsoft.Office.Core.Permission 对象,该对象表示工作簿中的权限设置。

public:
 property Microsoft::Office::Core::Permission ^ Permission { Microsoft::Office::Core::Permission ^ get(); };
public Microsoft.Office.Core.Permission Permission { get; }
member this.Permission : Microsoft.Office.Core.Permission
Public ReadOnly Property Permission As Permission

属性值

一个 Microsoft.Office.Core.Permission 对象,表示工作簿中的权限设置。

示例

下面的代码示例使用 Permission 属性在当前工作簿上未启用权限时显示一条消息。

此示例适用于文档级自定义项。

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

适用于