मुख्य सामग्री पर जाएं

Word दस्तावेज़ में प्रत्येक पृष्ठ को अलग-अलग पीडीएफ फाइलों के रूप में कैसे सहेजें?

लेखक: सिलुविया अंतिम संशोधित: 2020-05-28

Microsoft Word दस्तावेज़ का उपयोग करते समय, आप इसके बिल्ड-इन सेव अस फ़ंक्शन के साथ प्रत्येक पृष्ठ को एक-एक करके अलग-अलग पीडीएफ फाइलों के रूप में सहेज सकते हैं। हालाँकि, यदि सैकड़ों पृष्ठों को विभाजित करने और अलग-अलग पीडीएफ फाइलों के रूप में सहेजने की आवश्यकता है, तो आप ऐसा कैसे कर सकते हैं? यह आलेख आपको इस समस्या को शीघ्रता से हल करने की विधि प्रदान करता है।

प्रत्येक पृष्ठ को VBA कोड के साथ थोक में अलग-अलग पीडीएफ फाइलों के रूप में सहेजें


प्रत्येक पृष्ठ को VBA कोड के साथ थोक में अलग-अलग पीडीएफ फाइलों के रूप में सहेजें

नीचे दिया गया VBA कोड आपको दस्तावेज़ के प्रत्येक पृष्ठ को एक ही समय में अलग-अलग पीडीएफ फाइलों के रूप में शीघ्रता से सहेजने में मदद करता है। कृपया निम्नानुसार करें.

1. दस्तावेज़ खोलें, आप प्रत्येक पृष्ठ या विशिष्ट पृष्ठों को पीडीएफ फाइलों के रूप में सहेजेंगे, फिर दबाएँ ऑल्ट + F11 कुंजी को खोलने के लिए अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक खिड़की.

2। में अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक खिड़की, क्लिक करें सम्मिलित करें > मापांक, नीचे दिए गए VBA कोड को मॉड्यूल विंडो में कॉपी करें।

वीबीए कोड: प्रत्येक पृष्ठ को एक वर्ड दस्तावेज़ में एक ही समय में अलग-अलग पीडीएफ फाइलों के रूप में सहेजें

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

3। दबाएं F5 कोड चलाने की कुंजी.

4। में ब्राउज विंडो, पीडीएफ फाइलों को सहेजने के लिए एक फ़ोल्डर चुनें और क्लिक करें OK बटन। स्क्रीनशॉट देखें:

5. प्रथम में वर्ड के लिए कुटूल डायलॉग बॉक्स में, टेक्स्ट बॉक्स में अपने दस्तावेज़ का आरंभ पृष्ठ नंबर दर्ज करें और क्लिक करें OK.

6. दूसरे में वर्ड के लिए कुटूल संवाद बॉक्स में, अपने दस्तावेज़ का अंतिम पृष्ठ क्रमांक दर्ज करें, फिर क्लिक करें ठीक है. स्क्रीनशॉट देखें:

नोट: यदि आप दस्तावेज़ में लगातार कई पेजों को अलग-अलग पीडीएफ फाइलों जैसे पेज 4, 5 और 6 के रूप में सहेजना चाहते हैं, तो कृपया उपरोक्त दो संवाद बॉक्स में 4 और 6 को अलग-अलग दर्ज करें।

कोड चलाने के बाद, कृपया चरण 4 में आपके द्वारा चुने गए निर्दिष्ट फ़ोल्डर पर जाएं, आप देख सकते हैं कि सभी पेज अलग-अलग पीडीएफ फाइलों के रूप में विभाजित और सहेजे गए हैं जैसा कि नीचे स्क्रीनशॉट में दिखाया गया है।


दस्तावेज़ के प्रत्येक पृष्ठ को अलग-अलग नए दस्तावेज़ों के रूप में विभाजित करें और सहेजें:

RSI विभाजन दस्तावेज़ की उपयोगिता एक्सेल के लिए कुटूल जैसा कि नीचे दिए गए स्क्रीनशॉट में दिखाया गया है, यह आपको वर्तमान दस्तावेज़ के प्रत्येक पृष्ठ को अलग-अलग नए दस्तावेज़ के रूप में आसानी से विभाजित करने और सहेजने में मदद कर सकता है। अभी डाउनलोड करें और इसे आज़माएं! (60-दिन निःशुल्क ट्रेल)

सर्वोत्तम कार्यालय उत्पादकता उपकरण

वर्ड के लिए कुटूल - ओवर के साथ अपने शब्द अनुभव को उन्नत करें 100 उल्लेखनीय विशेषताएं!

🤖 कुटूल्स एआई असिस्टेंट: एआई के साथ अपना लेखन बदलें - सामग्री उत्पन्न करें  /  पाठ पुनः लिखें  /  दस्तावेज़ों को सारांशित करें  /  जानकारी के लिए पूछताछ करें दस्तावेज़ पर आधारित, सभी वर्ड के भीतर

📘 दस्तावेज़ महारत: पन्ने विभाजित करें  /  दस्तावेज़ मर्ज करें  /  विभिन्न प्रारूपों में निर्यात चयन (पीडीएफ/टीएक्सटी/डीओसी/एचटीएमएल...)  /  बैच को पीडीएफ में कनवर्ट करें  /  पेजों को छवियों के रूप में निर्यात करें  /  एक साथ अनेक फ़ाइलें प्रिंट करें...

सामग्री संपादन: बैच ढूंढें और बदलें अनेक फ़ाइलों में  /  सभी चित्रों का आकार बदलें  /  तालिका पंक्तियों और स्तंभों को स्थानांतरित करें  /  तालिका को पाठ में बदलें...

🧹 सहज स्वच्छ: साफ़ कर दो अतिरिक्त स्थान  /  अनुभाग टूट जाता है  /  सभी शीर्षलेख  /  पाठ बक्से  /  हाइपरलिंक  / अधिक हटाने वाले टूल के लिए, यहां जाएं समूह हटाएँ...

रचनात्मक निवेशन: डालें हजार विभाजक  /  चेक बॉक्स  /  रेडियो बटन  /  क्यूआर कोड  /  बारकोड  /  विकर्ण रेखा तालिका  /  समीकरण कैप्शन  /  तस्वीर का शीर्षक  /  सारणी का शीर्षक  /  एकाधिक चित्र  / में और अधिक खोजें समूह सम्मिलित करें...

🔍 परिशुद्धता चयन: सटीक विशिष्ट पृष्ठ  /  टेबल्स  /  आकृतियाँ  /  शीर्षक पैराग्राफ  / के साथ नेविगेशन बढ़ाएँ अधिक सुविधाएँ चुनें...

स्टार संवर्द्धन: किसी भी स्थान पर नेविगेट करें  /  दोहरावदार पाठ स्वतः सम्मिलित करें  /  दस्तावेज़ विंडोज़ के बीच टॉगल करें  /  11 रूपांतरण उपकरण...

👉 क्या आप इन सुविधाओं को आज़माना चाहते हैं? वर्ड के लिए कुटूल्स एक ऑफर करता है 60- दिन का नि: शुल्क परीक्षण, बिना किसी सीमा के! 🚀
 
Comments (26)
Rated 5 out of 5 · 3 ratings
This comment was minimized by the moderator on the site
How to set output File Name base on footer each page?
This comment was minimized by the moderator on the site
Hello,

I was wondering if there was a way to have it pull the name for the PDF from the word doc. Example: instead of Page_01, have a pull an account number that was the 3rd line down in the word document?
This comment was minimized by the moderator on the site
Hi
what if I need to set specific name for each splited PDF.
This should be taken from WORD text - it is serial korespondece- all pages have same format
Can you advise?
This comment was minimized by the moderator on the site
Hi, how would you save each pdf page as a name that can be found from within each word page being exported?
This comment was minimized by the moderator on the site
Hi, how will change the code for mac os?
This comment was minimized by the moderator on the site
Is there a way to save per 2 pages?

Ex. save page 1/2 in Page_1.pdf
save page 3/4 in Page_2.pdf

Thanks!
This comment was minimized by the moderator on the site
im wondering the same thing! please help!
This comment was minimized by the moderator on the site
Wondering the same
This comment was minimized by the moderator on the site
10x :) this was realy helpful!!!
Rated 5 out of 5
This comment was minimized by the moderator on the site
Thanks for this, this is great. i was wondering if you have a way of naming my pdf files differently per each extract not only Page_1.pdf.

Thanks
This comment was minimized by the moderator on the site
Hi samir,
How would you like to name these pdf files? Please give me an example.
This comment was minimized by the moderator on the site
Like saving each document with a different name, not just Page_1.pdf and so on.
This comment was minimized by the moderator on the site
Hi Camila,
The following VBA code can help you solve the problem.
Note: You need to specify a different name in this line: xFileName = "AA; BB; CC; DD". Here AA, BB and CC are the names for the PDF files.
Please change them to meet your needs. You can add more names and separate them by semicolon. To mention that the number of names specified must match the number of pages you expored. And the PDF files will be named in order of the specified names in the code.
Sub SaveAsSeparatePDFs()
'Updated by Extendoffice 20221223
    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
    Dim xFileName As String
    Dim xNameArr() As String

    xFileName = "AA; BB; CC; DD"  'Specify a name for each page. The number of names specified must match the number of pages you exported.The PDF files will be named in order of the the specified names
    xNameArr = VBA.Split(xFileName, ";")
    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 & "\" & VBA.Trim(xNameArr(I - 1)) & ".pdf", _
        wdExportFormatPDF, False, wdExportOptimizeForPrint, wdExportFromTo, I, I, wdExportDocumentWithMarkup, _
        False, False, wdExportCreateHeadingBookmarks, True, False, False
    Next
    Erase xNameArr
End Sub
This comment was minimized by the moderator on the site
Добрый день!
Есть ли возможность сохранить из ворд файла(используя слияние) в пдф файл - Решения собственников на общее собрание.
При этом учитываем, что PDF должен сохраняться так: в 1 файле должно быть несколько листов (1 квартира), по данному модулю страницы сохраняются в пдф, но раздельно
This comment was minimized by the moderator on the site
Hi,
Sorry I don't understand what you mean. You may need to attach a screenshot or a sample file to describe the problem you encountered more clearly.
This comment was minimized by the moderator on the site
Thanks for the script, it has also saved me a lot of work in exporting pages as pdf!
Rated 5 out of 5
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