Skip to main content

How to save each page as separate PDF files in a Word document?

Author: Siluvia Last Modified: 2025-04-11

In Microsoft Word, you can manually save each page as a separate PDF by using the built-in "Save As" feature and specifying the page number in the Options dialog. However, if you're working with a large document that has hundreds of pages, doing this manually can be time-consuming. This article introduces a method to quickly save all pages as individual PDF files.

Save each page as separate PDF files in bulk with VBA code


Save each page as separate PDF files in bulk with VBA code

You can use the VBA code below to automatically save each page in a Word document as an individual PDF file. Hereโ€™s how:

  1. Open the Word document you want to process. Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
  2. In the Visual Basic window, click "Insert" > "Module", and then paste the following VBA code into the module window:
    Sub SaveAsSeparatePDFs()
    'Updated by Extendoffice 20180906
        Dim I As Long
        Dim xStr As String
        Dim xPathStr As Variant
        Dim xDictoryStr As String
        Dim xFileDlg As FileDialog
        Dim xStartPage, xEndPage As Long
        Dim xStartPageStr, xEndPageStr As String
        Set xFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
        If xFileDlg.Show <> -1 Then
            MsgBox "Please chose a valid directory", vbInformation, "Kutools for Word"
            Exit Sub
        End If
        xPathStr = xFileDlg.SelectedItems(1)
        xStartPageStr = InputBox("Begin saving PDFs starting with page __? " & vbNewLine & "(ex: 1)", "Kutools for Word")
        xEndPageStr = InputBox("Save PDFs until page __?" & vbNewLine & "(ex: 7)", "Kutools for Word")
        If Not (IsNumeric(xStartPageStr) And IsNumeric(xEndPageStr)) Then
            MsgBox "The enterng start page and end page should be number format", vbInformation, "Kutools for Word"
            Exit Sub
        End If
        xStartPage = CInt(xStartPageStr)
        xEndPage = CInt(xEndPageStr)
        If xStartPage > xEndPage Then
            MsgBox "The start page number can't be larger than end page", vbInformation, "Kutools for Word"
            Exit Sub
        End If
        If xEndPage > ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then
            xEndPage = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
        End If
        For I = xStartPage To xEndPage
            ActiveDocument.ExportAsFixedFormat xPathStr & "\Page_" & I & ".pdf", _
            wdExportFormatPDF, False, wdExportOptimizeForPrint, wdExportFromTo, I, I, wdExportDocumentWithMarkup, _
            False, False, wdExportCreateHeadingBookmarks, True, False, False
        Next
    End Sub
    VBA window with Insert > Module selected and VBA code copied into the Module window
  3. Press F5 to run the code.
  4. In the Browse window that appears, select a folder to save the PDF files and click "OK".
    Browse window
  5. In the first "Kutools for Word" dialog box, enter the starting page number and click "OK".
    Kutools for Word dialog box with a text box for entering the start page number
  6. In the second "Kutools for Word" dialog box, enter the ending page number and click "OK".
    Second Kutools for Word dialog box with a text box for entering the last page number

    Note: For example, to save a few consecutive pagesโ€”pages 4, 5, and 6โ€”just enter "4" and "6" into the two dialog boxes.

After the script runs, go to the folder you selected in step 4. Youโ€™ll find that each specified page has been saved as a separate PDF file:

Pages are split and saved as individual PDF files

Easily split a Word document into multiple documents
Easily split a Word document into multiple documents with the Split Document utility. Instead of manually copying and pasting, this tool allows you to split your document based on page, Heading 1, page breaks, or section breaks - dramatically improving efficiency.
A screenshot of the Split Document utility splitting a Word document by page
Kutools for Word: Enhance your Word experience with hundreds of handy tools. Download now and see the difference!

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

๐Ÿค– Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...

๐Ÿ“˜ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...

โœ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...

๐Ÿงน Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...

โž• Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...

๐Ÿ” Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...

โญ Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...

๐ŸŒ Supports 40+ Languages: Use Kutools in your preferred language โ€“ supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools and Kutools Plus tabs on the Word Ribbon
๐Ÿ‘‰ Want to try these features? Download Kutools for Word now! ๐Ÿš€
 

Best Office Productivity Tools

Kutools for Word - 100+ Tools for Word