Protect Document - Remove Editing Restrictions

Posted on 2009-02-12
Last Modified: 2012-08-13
I recently created a template that uses editing restriction from the Protect Document Task Pane. In my code I want to be able to remove that protection for a specific user which I can do. The only caveat is that I am unable to remove the Highlighted Unprotected portions of the document. The only way I am able to do this is through the Task Pane by unselectting the Editing Restrictions checkbox and answering "yes" to the dialog pop-up which asks if I want to ignore exceptions. This is what I want to do in the code (VBA)

Any suggestions?

NB: ActiveWindow.View.ShadeEditableRanges  does not work after UNPROTECT

Thanks in advance for your help
ActiveDocument.UnProtect "mypassword"

ActiveWindow.View.ShadeEditableRanges  = false

'Still the old editable words highlighted with gray (problem when printing)

Open in new window

Question by:fakoua
    1 Comment
    LVL 1

    Accepted Solution

    I found the solution, so I want to share it with you and close this question.
    Actually I do loop within all th bookmarks and remove the permission everyone, so the problem was solved. see code below

    ForEach mb as BookMark in my document.bookmarks 'All my editable lines are bookmark
     If bm.Range.Editors.Item(1).Name = "Everyone" Then
     End If

    Open in new window


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
    I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
    This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
    In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now