Quote:
Originally Posted by donaldadams1951
The user does not want to see the title but the title contains unique text that is the "marker" to identify the section that might need to be deleted with a macro. It can't be deleted manually by the user as the text is in a protected section that is read-only.
|
Perhaps you could consider using a Custom Document Property or Document Variable to hold a value that an IF field in the body of the document can use to conditionally display/hide all of the applicable content. That way, there's no "marker" to be concerned with, and no need to worry about font colours, etc. If, for example, you create a Custom Document Property named 'MyProp', you could use a field coded as:
{IF{DOCPROPERTY MyProp}= 1 "Conditional Content to Show"}
The macro you're using to drive the process would then only need something like:
Code:
With ActiveDocument
.CustomDocumentProperties("MyProp").Value = 0
.Fields.Update
End With
to hide the content, and:
Code:
With ActiveDocument
.CustomDocumentProperties("MyProp").Value = 1
.Fields.Update
End With
to display it again after it's been hidden.