How to split a Word document and save as separate PDF file?
In Word, you can save the whole document to a PDF file, but have you ever tried to split the document and then save the pages as separate PDF file? In this article, I will introduce the methods on solving this job quickly.
Here the VBA code can help you directly split a Word document by pages then save as separate PDF files.
1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window.
2. Click Insert > Module, copy and paste below code to the Module window.
VBA: Save Word as separate PDF
Sub SaveAsSeparatePDFs() 'UpdatebyExtendoffice20181120 Dim I As Long Dim xDlg As FileDialog Dim xFolder As Variant Dim xStart, xEnd As Integer On Error GoTo lbl Set xDlg = Application.FileDialog(msoFileDialogFolderPicker) If xDlg.Show <> -1 Then Exit Sub xFolder = xDlg.SelectedItems(1) xStart = CInt(InputBox("Start Page", "KuTools for Word")) xEnd = CInt(InputBox("End Page:", "KuTools for Word")) If xStart <= xEnd Then For I = xStart To xEnd ActiveDocument.ExportAsFixedFormat OutputFileName:= _ xFolder & "\Page_" & I & ".pdf", ExportFormat:=wdExportFormatPDF, _ OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:= _ wdExportFromTo, From:=I, To:=I, Item:=wdExportDocumentContent, _ IncludeDocProps:=False, KeepIRM:=False, CreateBookmarks:= _ wdExportCreateHeadingBookmarks, DocStructureTags:=True, _ BitmapMissingFonts:=False, UseISO19005_1:=False Next End If Exit Sub lbl: MsgBox "Enter right page number", vbInformation, "KuTools for Word" End Sub
3. Press F5 key, in Browse dialog, select a folder to place the PDF files.
4. Click OK, then enter the page numbers you want to split start and end.
5. Click OK. Now the pages have been saved as separate PDF files.
If you just want to split a Word document to separate Word file, you can try Kutools for Word’s Split utility, it can split a document by heading1, page break, section break or pages as you need.
|Kutools for Word, with more than 100 handy functions, makes your jobs easier.|
After installing Kutools for Word, please do as below:（Free Download Kutools for Word Now!)
Tabbed browsing & editing multiple Word documents/Excel workbooks as Firefox, Chrome, Internet Explore 10!
You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents or Excel workbooks in one Word window or Excel window, and easily switch between them by clicking their tabs.
Recommended Word Productivity Tools
- Complicated and repeated operations can be done one-time processing in seconds.
- Insert multiple images across folders into Word document at once.
- Merge and combine multiple Word files across folders into one with your desired order.
- Split the current document into separate documents according to heading, section break or other criteria.
- Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
You are guest
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 1 months ago@mfadlihr Can't find the code to handle your job now. Try the Kutools for Word, it is free for using in 60 days
To post as a guest, your comment is unpublished.· 1 months agoPlease kindly explain : (Renaming doc) You could do this using the REN function if you open the CMD in the folder with the documents saved - and also 2 pages docs into one pdf
To post as a guest, your comment is unpublished.· 2 months agoInstead of saving each page as a separate document, how do I get the code to save every 2 or 3 pages as a separate document.
To post as a guest, your comment is unpublished.· 2 months ago@jgall7804 You could do this using the REN function if you open the CMD in the folder with the documents saved
To post as a guest, your comment is unpublished.· 2 months agoOMG, you saved my life. I always need to do merge letters in word and then save each one individually in PDF. My last 40 letters was so fast!!! :)
To post as a guest, your comment is unpublished.· 2 months ago@jgall7804 Sorry I have no idea.
To post as a guest, your comment is unpublished.· 3 months agois there a way to name the files from text in the document instead of page 1, page 2 ,etc?
To post as a guest, your comment is unpublished.· 3 months ago@Nico Hi, Nico, I have try the code again, it works in my version window 10 64 2016, which version you use?
To post as a guest, your comment is unpublished.· 3 months agoVBA code does not work. Keeps saying "enter right page number. Word document is 3 pages long. I added in 1 and 3 in the messageboxes and got the error.