View Single Post
 
Old 08-03-2018, 08:28 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The code uses the source template to create the new document and the
Code:
oDoc.Range.Text = ""
line ensures that the text in that document is removed first. The remaining bookmarks are added at the end of the document.


If you need Chapter 1 and Chapter 2 to be included always, the simplest approach is to check the two check boxes and change their properties to check the option 'Contents cannot be edited'. Then they cannot be changed from the template.


The lines
Code:
    Else
        MsgBox "No checkboxes were checked"
are then superfluous.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote