Share via


DocumentBase.DeleteAllEditableRanges 方法

刪除所有範圍的使用權限,在該範圍中指定的使用者或使用者群組具有修改權限。

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

語法

'宣告
Public Sub DeleteAllEditableRanges ( _
    ByRef editorID As Object _
)
public void DeleteAllEditableRanges(
    ref Object editorID
)

參數

  • editorID
    型別:System.Object%
    其中一個 WdEditorType 值,表示使用者群組、使用者的電子郵件別名 (如果在相同網域中) 或電子郵件地址。如果省略,就不會從文件中刪除使用權限。

備註

您也可以使用 Microsoft.Office.Interop.Word.Editor 物件的 Editor.DeleteAll 方法,針對指定的使用者或使用者群組具有修改權限的所有範圍,刪除使用權限。

範例

下列程式碼範例會使用 DeleteAllEditableRanges 方法,針對目前使用者的所有範圍刪除所有使用權限。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentDeleteAllEditableRanges()
    Me.DeleteAllEditableRanges(Word.WdEditorType.wdEditorCurrent)
End Sub
private void DocumentDeleteAllEditableRanges()
{
    object editorID = Word.WdEditorType.wdEditorCurrent;
    this.DeleteAllEditableRanges(ref editorID);
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間