共用方式為


DocumentBase.Permission Property

Definition

Gets a Permission that represents the permission settings for the document.

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

Property Value

A Permission that represents the permission settings for the document.

Examples

The following code example checks if permission is enabled for the document and displays a message that shows the results. To use this example, run it from the ThisDocument class in a document-level project.

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 

Applies to