Breaking a Document Up Based on Heading 1 Styles

Written by Allen Wyatt (last updated June 20, 2026)

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:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Converting Text to Values

When you import information originating in a different program, Excel may not do the best job at figuring out what ...

Discover More

Magnifying Only the Current Cell

You can use the Zoom feature of Excel to magnify what Excel shows of your workbook, but it affects the entire screen. ...

Discover More

Changing the Color of a List of Words

The Find and Replace tool is very powerful. If you need to use it many, many times in a row, however, it can quickly get ...

Discover More

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!

More WordTips (ribbon)

Opening a Word Document when Starting the Computer

Some people use their computers for little else, other than to work on Word documents. If that is the case with you, then ...

Discover More

Opening Multiple Documents at Once

Word's Open dialog box provides many of the same file management functions as Windows Explorer does. One of the functions ...

Discover More

Saving Everything

Need to force users to save their work? It may be as simple as implementing a couple of macros that get a bit more ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one more than 8?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.