Is there a way to permanently remove highlighting from editable areas within a protected word document?

24,196

Solution 1

I believe you will need a macro for that.
As I have never written a VBA macro, here are some quotes from people who have:

From How do I get rid of form field shading in Word? :

If you are using a highlight on the formfields - which you must have put before you protected - then you have to unprotect the document to remove the highlight.

Dim oFF As FormField
'  remove shading
ActiveDocument.FormFields.Shaded = False
' unprotect
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
    ActiveDocument.Unprotect
End If
' remove highlighting
For Each oFF In ActiveDocument.FormFields
    oFF.Range.HighlightColorIndex = wdNoHighlight
Next
' re-protect
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True, Password:=""

Some more info from Change the colour that indicates sections that are editable :

There isn't a way to change the highlight colour used by Word to shade editable regions. You can programmatically turn shading of editable regions off by using the Window.View.ShadeEditableRanges property and setting it to False.

Of course if you do this, you will lose the automatic yellow highlighting that Word provides. You would then have to write some code to highlight the ranges by yourself that are editable in the document, code like:

Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorGray15

Some problems with this approach:

1) If the user selects the entire region and deletes it the gray background color will be lost.

2) The gray background colors will print when the document prints, so you'll have to handle the BeforePrint event and remove the gray background colors before it prints.

Solution 2

One alternative which requires no macros is to use protected sections with filling in forms enabled instead of editable ranges:

  1. Firstly insert continuous section breaks around the content want to remain editable.
  2. Click on Restrict Editing from the Review toolbar then under Editing Restrictions choose Filling in Forms.
  3. Click Select Sections underneath and select all the other sections that are not part of your editable content.
  4. Click Start enforcing protection.

What you should find after this is done is you can still only edit that particular part of the document just like with editable ranges, however now there are no yellow brackets at all. This goes the same for anyone else who opens the document. Obviously the other sections do not contain form fields otherwise they will be editable.

Share:
24,196

Related videos on Youtube

CT.
Author by

CT.

Updated on September 17, 2022

Comments

  • CT.
    CT. over 1 year

    Is there a way to permanently remove highlighting from editable areas within a protected word document?

    This is in relation to a previous question I had on locking portions of a Word Document located here: Can I lock (or make uneditable) portions of a word document?

    Using this solution, any editable area is highlighted. You can uncheck the Highlight editable area box within the Protect Document bar but if you save and reopen the area is highlighted again. The document is on a network drive. If another user were to open the document it would also be highlighted.

    Is there anyway to permanently turn this highlighting off so that when a user accesses the document from the network they do not see this highlighting?

    Using Word 2007.

  • Luke
    Luke about 9 years
    This really is a very good solution.