Share via


DocumentBase.Permission 屬性

取得 Permission,表示文件的使用權限設定。

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

語法

'宣告
Public ReadOnly Property Permission As Permission
public Permission Permission { get; }

屬性值

型別:Microsoft.Office.Core.Permission
Permission ,表示文件的使用權限設定。

範例

下列程式碼範例會檢查是否已啟用文件的使用權限,並且顯示訊息說明結果。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間