View Single Post
 
Old 03-12-2024, 11:07 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
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

You don't even need to identify the section number e.g.
Code:
Sub CopyCurrentSectionToNewDoc()
Dim rng As Range
Dim NewDoc As Document
    Set rng = Selection.Sections(1).Range
    rng.End = rng.End - 1
    Set NewDoc = Documents.Add(Template:=ActiveDocument.AttachedTemplate.FullName, Visible:=True)
    NewDoc.Range.FormattedText = rng.FormattedText
End Sub
__________________
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