View Single Post
 
Old 05-13-2019, 05:33 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Wrap your conditional text is a rich text content control e.g., title it "Kill me"


Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim bCheck As Boolean
Dim oRng As Range
  bCheck = False 'Simulates your check box unchecked state.
  If Not bCheck Then
    Set oRng = ActiveDocument.SelectContentControlsByTitle("Kill me").Item(1).Range.Paragraphs(1).Range
    ActiveDocument.SelectContentControlsByTitle("Kill me").Item(1).Delete True
    oRng.Delete
  End If
lbl_Exit:
  Exit Sub
  
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote