메인 컨텐츠로 가기

Word 문서를 분할하고 별도의 PDF 파일로 저장하는 방법은 무엇입니까?

Word에서 전체 문서를 PDF 파일로 저장할 수 있지만 문서를 분할 한 다음 페이지를 별도의 PDF 파일로 저장해 본 적이 있습니까? 이 기사에서는이 일을 빠르게 해결하는 방법을 소개합니다.

VBA를 사용하여 Word 문서를 분할하고 별도의 PDF 파일로 저장

Word 문서를 분할하여 페이지/제목1/ 나누기로 파일을 분리한 다음 PDF로 저장


VBA를 사용하여 Word 문서를 분할하고 별도의 PDF 파일로 저장

여기에서 VBA 코드를 사용하면 Word 문서를 페이지별로 직접 분할 한 다음 별도의 PDF 파일로 저장할 수 있습니다.

1. 프레스 Alt + F11 활성화 할 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 클릭 끼워 넣다 > 모듈, 복사하여 아래 코드에 붙여 넣으십시오. 모듈 창.

VBA : Word를 별도의 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. 프레스 F5 키를 누르고 찾아보기 대화 상자에서 PDF 파일을 저장할 폴더를 선택합니다.
문서 분할 저장 PDF 1

4. 클릭 OK을 클릭 한 다음 시작과 끝을 분할 할 페이지 번호를 입력하십시오.

문서 분할 저장 PDF 2 문서 분할 저장 PDF 3

5. 클릭 OK. 이제 페이지가 별도의 PDF 파일로 저장되었습니다.
문서 분할 저장 PDF 4


Word 문서를 분할하여 페이지/제목1/ 나누기로 파일을 분리한 다음 PDF로 저장

VBA 코드에 익숙하지 않은 경우 추가 기능 도구를 사용해 볼 수 있습니다. Word 용 Kutools스플릿 이 기능을 사용하면 페이지 나누기, 페이지 번호, 제목 1, 섹션 나누기, 모든 n번째 페이지 및 지정한 사용자 정의 페이지 번호를 기반으로 Word 문서를 페이지로 분할한 다음 적용할 수 있습니다. 문서 형식 변환기 분할 Word 문서를 PDF로 일괄 변환합니다.

설치 후 Word 용 Kutools는 다음과 같이하십시오.(지금 Word 용 Kutools 무료 다운로드!)

1. 분할로 변환하려는 Word 문서를 활성화하고 쿠툴즈 플러스 > 스플릿.

2. 에서 문서 분할 대화 상자에서 분할 기준 섹션에서 필요에 따라 분할 규칙을 선택합니다. 그런 다음 저장 위치와 분할 문서 파일 접두사를 지정합니다. 딸깍 하는 소리 Ok.

. 분할 기준 섹션에서는 6가지 분할 유형을 제공합니다. 모든 분할 유형에 대한 자세한 내용은 다음을 참조하십시오. 기능 소개.

이제 분할 문서가 지정된 위치에 저장되었습니다.

3. 문서 분할 후 쿠툴즈 플러스 > 문서 / Docx.

4. 에서 문서 형식 변환기 대화 상자, 선택 Docx를 PDF로 변환 형태 형식 변환기 드롭다운 목록에서 더하기 기호를 클릭하여 PDF로 변환하려는 문서가 포함된 파일 또는 폴더를 추가한 다음 필요에 따라 다른 설정을 지정합니다(기본적으로 원본 폴더에 PDF 파일을 저장하고 변경할 수 있습니다. ). 딸깍 하는 소리 Ok.

이제 Word 문서가 PDF 파일로 변환되었습니다.


최고의 사무 생산성 도구

Word 용 Kutools - Over로 단어 경험을 향상시키세요 100 놀라운 기능!

🤖 Kutools AI 도우미: AI로 글쓰기를 변화시키세요 - 콘텐츠 생성  /  텍스트 다시 쓰기  /  문서 요약  /  정보 문의 문서 기반, 모두 Word 내에서

📘 문서 숙달: 페이지 분할  /  문서 병합  /  다양한 형식으로 선택 항목 내보내기(PDF/TXT/DOC/HTML...)  /  PDF로 일괄 변환  /  페이지를 이미지로 내보내기  /  한 번에 여러 파일 인쇄...

컨텐츠 편집: 일괄 찾기 및 바꾸기 여러 파일에 걸쳐  /  모든 사진 크기 조정  /  테이블 행과 열 바꾸기  /  표를 텍스트로 변환...

🧹 손쉬운 청소: 쓸어버리다 추가 공간  /  섹션 나누기  /  모든 헤더  /  텍스트 상자  /  하이퍼 링크  / 더 많은 제거 도구를 보려면 다음 페이지를 방문하세요. 그룹 제거...

광고 삽입물: 삽입 천 단위 구분 기호  /  확인란  /  라디오 버튼  /  QR 코드  /  바코드  /  대각선 표  /  방정식 캡션  /  이미지 캡션  /  테이블 캡션  /  여러 장의 사진  / 더 자세히 알아보세요. 그룹 삽입...

🔍 정밀한 선택: 핀포인트 특정 페이지  /  테이블  /  모양  /  제목 단락  / 탐색 기능 향상 배우기 기능 선택...

스타 강화: 어떤 위치로든 빠르게 이동  /  반복되는 텍스트 자동 삽입  /  문서 창 간을 원활하게 전환합니다.  /  11 변환 도구...

👉 이러한 기능을 사용해 보고 싶으신가요? Word 용 Kutools는 다음을 제공합니다. 60 일 무료 사용, 제한 없음! 🚀
 
Comments (27)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Very useful. I appreciate the work. Wish we can select how many pages for a split
This comment was minimized by the moderator on the site
Hi, the Split feature already support split specific pages and save as PDF only.
Choose Custom from the drop-down list in Split by section, then type the pasge numbers seperated by commas in the Page textbox, please see screenshot:
https://www.extendoffice.com/images/stories/comments/sun-comment/split-word-1.png?1702630242000
This comment was minimized by the moderator on the site
Kedves Napos!

Mostmár majdnem tökéletes a kód ahhoz, amit szeretnék. A 9. sorból szeretném a fájl nevét venni, de csak a 20. karaktertől.

Ez megoldható lenne?

Nagyon szépen köszönöm.

minimorisz
This comment was minimized by the moderator on the site
Hi, try this vba
Sub SaveAsSeparatePDFs()
'UpdatebyExtendoffice20221122
    Dim I As Long
    Dim xDlg As FileDialog
    Dim xFolder As Variant
    Dim xStart, xEnd As Integer
    Dim xName As String
    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
            xName = InputBox("Page: " & I, "Enter the name for this page")
            ActiveDocument.ExportAsFixedFormat OutputFileName:= _
                xFolder & "\" & xName & ".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

You will rename the pdf file one by one in the poping dialog while applying the vba.
This comment was minimized by the moderator on the site
Hi Sunny,

any chance you know the code for the file name to be taken from the Third line of the file? or a specific location?

thank you!
This comment was minimized by the moderator on the site
Hi, try this vba
Sub SaveAsSeparatePDFs()

'UpdatebyExtendoffice20221221
    Dim I As Long
    Dim xDlg As FileDialog
    Dim xFolder As Variant
    Dim xStart, xEnd As Integer
    Dim xStrName As String
    Dim xPath As String
'    On Error Resume Next

    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
                Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=I
                Selection.GoTo What:=wdGoToLine, Which:=wdGoToNext, Name:=3 - 1
                Selection.Extend
                Selection.EndKey Unit:=wdLine
                Selection.EscapeKey
   
                xStrName = Selection.Range
                xStrName = Replace(xStrName, " ", "")
                xStrName = Replace(xStrName, vbLf, "")
                xStrName = Replace(xStrName, Chr(10), "")
                xStrName = Replace(xStrName, Chr(13), "")
                xStrName = Replace(xStrName, "\", "")
                xStrName = Replace(xStrName, "/", "")
                xStrName = Replace(xStrName, ":", "")
                xStrName = Replace(xStrName, "*", "")
                xStrName = Replace(xStrName, "?", "")
                xStrName = Replace(xStrName, "<", "")
                xStrName = Replace(xStrName, ">", "")
                xStrName = Replace(xStrName, "|", "")
                xStrName = Replace(xStrName, """", "")
                If xStrName = "" Then
                    xStrName = I
                End If
                xPath = xFolder & "\" & xStrName & ".pdf"
                ActiveDocument.ExportAsFixedFormat OutputFileName:=xPath, 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
End Sub

If there is empty in the third line, the pdf file will be named with number.
This comment was minimized by the moderator on the site
Kedves Napos!

Ez a kód már majdnem tökéletes, a fájl elnevezéséből még ki kellene valahogyan szedni a Az eszközökért felelős személy neve részt, és akkor csak a dolgozó neve maradna.
Köszönöm szépen!

minimorisz
This comment was minimized by the moderator on the site
Kérnék részlete leírást arról, hogy hogyan tudom elnevezni a létrehozott dokumentumokat egy lépésben, akár VBA-val.
Köszönöm.
This comment was minimized by the moderator on the site
Hi,

This code spilts the mail merge into individual PDF's. But I need to split the first 2 pages as one doc. Means if there are 12 pages I need 6 PDF docs. A set of 2 into one PDF file. Right now this code splits it into 12 individual files. Please advise what should I change in the code.
This comment was minimized by the moderator on the site
Hi, SAROJ, I suggest that using tools in Kutools for Word, steps are the same as my reply for TEILLET
This comment was minimized by the moderator on the site
Bonjour,
Est-il possible de changer le module pour fractionner le fichier word en PDF toutes les 24 pages ?

Merci de votre aide
This comment was minimized by the moderator on the site
Hi, TEILLET, you can apply Kutools for Word's Split Document feature, and choose every n pages in the Split by section, then type 24 into Every n pages textbox, specify other settings, then click Ok, every 24 pages will be seperated as one single document. Then apply You should try Doc/Docx feature of Kutools for Excel, and choose Convert Docx to PDF from Format Convert section, and choose one location to save, click Ok, now every 24 page has been saved as PDF.
We have upgraded the features in Kutools for Word, but this article has not update, so the screenshots are old. We will update the contents soon, you can follow the steps to achieve.


Kutools for Word is free in 60-day, you may find more useful tool. Free Download
This comment was minimized by the moderator on the site
Very helpful and easy to use tip. Saved me a lot of time. Thank you so much.
This comment was minimized by the moderator on the site
Hello,When I click okay, the screen disappears but nothing is saved?Is there another setting I need to enable somewhere?
Also, the save to goes to my One Drive local folder, if that might be an issue?Thanks
This comment was minimized by the moderator on the site
Is there also a possibility to save the files not as Page 1 or Page 2, but with a name based on the content of the page?
This comment was minimized by the moderator on the site
I had able split document, need the guidance if i want to save the document with individual name
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations