View Single Post
 
Old 04-05-2019, 07:06 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

As for the checkbox (included specific paragraphs). That depends on the strategy you use. One is to just include everything in the template and then delete the pieces you don't want:


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