Solved

Word 2003 - VBA code to find out if text is assigned as editable or not?

Posted on 2014-02-20
3
603 Views
Last Modified: 2014-02-20
Hi Gurus

I can assign a range of text so that it can be edited by 'everyone' by using this code:

        Selection.Editors.Add wdEditorEveryone

And I can prevent a range of text from being edited by everyone by using this:

       Selection.Editors(wdEditorEveryone).Delete

But how can I test what has been set for a range of selected text?  I need to know if it has been assigned to everyone or not.  

I'm sure it's very simple but I can't find it.  Hope you can help.

Thanks
0
Comment
Question by:hj_daisy
3 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 150 total points
ID: 39873326
Hi,

it seems that the Editors Object can only return a Count

'If there is an editor
If Selection.Editors.Count >0 Then
' 
Else ' No Editors

End If

Open in new window

Regards
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 150 total points
ID: 39873525
Actually you can get the Editor objects as well, but For Each doesn't work on the collection. You have to count through.
Dim ed As Word.Editor
Dim i As Integer

For i = 1 To Selection.Editors.Count
    Set ed = Selection.Editors(i)
    Debug.Print ed.Name
Next i

Open in new window

0
 

Author Closing Comment

by:hj_daisy
ID: 39875394
Both solutions have led me to get the macro information that I need, so am awarding the solution to both.  

Appreciate your help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question