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: http://superuser.com/questions/143860/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.

link|improve this question

80% accept rate
feedback

1 Answer

up vote 1 down vote accepted

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.