View Single Post
 
Old 05-31-2018, 04:36 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by donaldadams1951 View Post
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.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote