![]() |
|
#2
|
|||
|
|||
|
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
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apply a formula or not depending on checkbox status | 14spar15 | Excel | 1 | 10-12-2018 01:14 PM |
| Bookmark will not show/hide based on CC Checkbox | lord_kaiser | Word VBA | 1 | 04-17-2018 01:19 AM |
Hide/Show text based upon check box status
|
nathan.gray@emerson.com | Word VBA | 5 | 12-08-2017 01:08 PM |
Show current section in status bar
|
Phil H | Word | 2 | 02-02-2016 01:45 PM |
Show/Hide Text based on Checkbox Selection
|
tammytran105 | Word VBA | 7 | 10-02-2014 04:30 PM |