Gwen has a long document that she wants to break into individual Word documents. She would like each Word document to contain all text that begins with a Heading 1 style. Thus, there would be however many documents as there are Heading 1 styles within the original document.
This can be accomplished with or without a macro. If you only need to do it once, then you can manually do the saving by working in Outline view. While in this view, to the left of each heading is a small circle with a plus sign in it. Click that circle, and the heading along with all subordinate paragraphs is selected. Thus, if you click the circle to the left of a Heading 1 paragraph, then everything under that heading, up to the next Heading 1 paragraph, is selected.
At this point, you can then press Ctrl+C, open a new document, and paste the content to that document. Save it using whatever name you want and then repeat the process for each additional Heading 1 in the original document.
If you need to do this process more often, on more documents, then a macro is definitely the way to go. The following is a simple macro that will essentially perform the steps just described:
Sub SeparateByStyleHeading1()
Dim P As Paragraph
Dim DocNum As Long
Dim SourceDoc As Document
Set SourceDoc = ActiveDocument
If SourceDoc.Path = "" Then
MsgBox "The active document must have been saved " & _
"before this macro is run.", vbCritical
Exit Sub
End If
DocNum = 0
For Each P In SourceDoc.Paragraphs
If P.Range.Style = SourceDoc.Styles(wdStyleHeading1) Then
P.Range.Select
SourceDoc.Bookmarks("\HeadingLevel").Range.Copy
With Documents.Add(Template:=SourceDoc.FullName, _
DocumentType:=wdNewBlankDocument)
.Content.Paste
DocNum = DocNum + 1
.SaveAs2 SourceDoc.Path & Application.PathSeparator & _
"Part" & Format(DocNum, "0000") & ".docx"
.Close
End With
SourceDoc.Activate
End If
Next P
End Sub
The macro works because the built-in \HeadingLevel bookmark refers to the heading level of the selected paragraph, along with any subordinate paragraphs—exactly what Gwen is looking for. Everything before the first Heading 1 paragraph is ignored and not saved to a new document.
When saving files, the macro saves them in the same folder as the document being processed. The files are named in the format Part0001.docx, with the number incrementing for each Heading 1 paragraph encountered. Before running the macro, you'll want to ensure that there are no other files in the folder that would cause a naming conflict with the files created by the macro.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11979) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2021 or Microsoft 365. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word Step by Step today!
Some people use their computers for little else, other than to work on Word documents. If that is the case with you, then ...
Discover MoreWord's Open dialog box provides many of the same file management functions as Windows Explorer does. One of the functions ...
Discover MoreNeed to force users to save their work? It may be as simple as implementing a couple of macros that get a bit more ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments