Partager via


DocumentBase.DeleteAllEditableRanges Method

Deletes permissions in all ranges that the specified user or group of users has permission to modify.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

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

Parameters

  • editorID
    Type: System.Object%

    One of the WdEditorType values that represents a group of users, or a user's e-mail alias (if in the same domain), or an e-mail address. If omitted, no permissions are deleted from the document.

Remarks

You can also use the Editor.DeleteAll method of the Microsoft.Office.Interop.Word.Editor object to delete permissions in all ranges that a specified user or group of users has permission to modify.

Examples

The following code example uses the DeleteAllEditableRanges method to delete all permissions in all ranges for the current user. To use this example, run it from the ThisDocument class in a document-level project.

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

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace