Class Editor (Word VBA)

The class Editor represents a single user who has been given specific permissions to edit portions of a document.

The main procedures of class Editor are Delete and Editors.Add

Set

To use a Editor class variable it first needs to be instantiated, for example

Dim edt as Editor
Set edt = ActiveDocument.Range.Editors(Index:=1)

The following procedures can be used to set variables of type Editor: Editors.Add, Editors.Item, Range.Editors and Selection.Editors

For Each

Here is an example of processing the Editor items in a collection.

Dim edt As Editor
For Each edt In ActiveDocument.Range.Editors
	
Next edt

Methods

These are the main methods of the Editor class

Delete - Deletes the specified Editor object.

ActiveDocument.Range.Editors(1).Delete

Editors.Add - Returns an Editor object that represents a new permission for a specified user to modify a range or selection within a document.

Dim strEditorID As String: strEditorID =  
Dim edt As Editor
Set edt = ActiveDocument.Range.Editors.Add(EditorID:=strEditorID)

Properties

ID returns or sets the identifying label for the specified object when the parent document is saved as a webpage.

Dim strID As String
strID = ActiveDocument.Range.Editors(1).ID

Name returns or sets the name of the specified object.

Dim strName As String
strName = ActiveDocument.Range.Editors(1).Name

NextRange returns a Range object that represents the next range for which a user has permissions to modify.

Dim rngNextRange As Range
Set rngNextRange = ActiveDocument.Range.Editors(1).NextRange

Parent returns an object that represents the parent object of the specified Editor object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Editors(1).Parent

Range returns a Range object that represents the portion of a document that is contained in the specified object.

Dim rngRange As Range
Set rngRange = ActiveDocument.Range.Editors(1).Range

Editors.Count returns a the Long that represents the number of Editor objects in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Range.Editors.Count

Editors.Parent returns an object that represents the parent object of the specified Editors object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Editors.Parent