<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[מיזוג דואר שמירת קובץ PDF נפרד לכל רשומה]]></title><description><![CDATA[<p dir="auto">שלום לכולם<br />
התבקשתי רבות מחברים פיתרון לבעיה הידועה לבצע מיזוג דואר, אך לשמור קובץ PDF נפרד לכל רשומה, עם שם מותאם אישית.</p>
<p dir="auto">אפרט כאן במדריך שלב אחר שלב איך לבצע זאת, תהיו איתי עד הסוף מקווה שתהנו...</p>
<p dir="auto">נתחיל...</p>
<p dir="auto"><strong>שלב א:</strong></p>
<p dir="auto">ראשית בקובץ ה- Excel של רשימת הנמענים, הוסיפו לטבלת הנתונים ארבעה עמודות בשמות כדלהלן (חשוב שהשמות יהיו מדויקים ללא רווחים מיותרים - לתשומת ליבכם):</p>
<ul>
<li>
<p dir="auto">DocFolderPath</p>
</li>
<li>
<p dir="auto">DocFileName</p>
</li>
<li>
<p dir="auto">PdfFolderPath</p>
</li>
<li>
<p dir="auto">PdfFileName</p>
</li>
</ul>
<p dir="auto"><strong>שלב ב:</strong><br />
צרו שתי תיקיות נפרדות, אחד לקבצי הפלט בפורמט docx, ואחד לקבצי הקלט בפורמט pdf, העתיקו את נתיב התיקייה של קבצי ה- docx והדביקו אותם עבור כל רשומה בשדה שיצרתם בשם DocFolderPath, לאחמ"כ חזרו על הפעולה והפעם העתיקו את נתיב התיקייה של קובצי ה- PDF והדביקו בשדה PdfFolderPath.<br />
בשדה <strong>DocFileName</strong> כתבו את השם של הקובץ עבור הרשומה - ניתן להשתמש בנוסחאות, כמו"כ בשדה <strong>PdfFileName</strong> כתבו את שם הקובץ כנ"ל.</p>
<p dir="auto"><strong>שלב ג:</strong><br />
פתחו את קובץ ה- word והשלימו את פעולת המיזוג כרגיל, עצבו את המסמך כרצונכם.</p>
<p dir="auto"><strong>שלב ד:</strong><br />
פתחו את לשונית מפתחים בקובץ ה- word פתחו את עורך הקוד הוסיפו מודל חדש מצו"ב צילום מסך:<br />
<img src="/assets/uploads/files/1662883665514-3eb2538f-9ab1-41eb-a1df-452212916da6-image.png" alt="3eb2538f-9ab1-41eb-a1df-452212916da6-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">הדביקו את הקוד הבא:</p>
<pre><code>Sub MailMergeToPdfBasic()                                                        ' Mark the start of the Subroutine (i.e. Macro) and name it "MailMergeToPdf"
' Macro created by Imnoss Ltd
' Please share freely while retaining attribution
' Last Updated 2021-05-03
    Dim masterDoc As Document, singleDoc As Document, lastRecordNum As Long   ' Create variables ("Post-it Notes") for later use
    Set masterDoc = ActiveDocument                                               ' Identify the ActiveDocument (foremost doc when Macro run) as "masterDoc"

    masterDoc.MailMerge.DataSource.ActiveRecord = wdLastRecord                   ' jump to the last active record (active = ticked in edit recipients)
    lastRecordNum = masterDoc.MailMerge.DataSource.ActiveRecord                  ' retrieve the record number of the last active record so we know when to stop

    masterDoc.MailMerge.DataSource.ActiveRecord = wdFirstRecord                  ' jump to the first active record (active = ticked in edit recipients)
    Do While lastRecordNum &gt; 0                                                   ' create a loop, lastRecordNum is used to end the loop by setting to zero (see below)
        masterDoc.MailMerge.Destination = wdSendToNewDocument                    ' Identify that we are creating a word docx (and no e.g. an email)
        masterDoc.MailMerge.DataSource.FirstRecord = masterDoc.MailMerge.DataSource.ActiveRecord              ' Limit the selection to just one document by setting the start ...
        masterDoc.MailMerge.DataSource.LastRecord = masterDoc.MailMerge.DataSource.ActiveRecord               ' ... and end points to the active record
        masterDoc.MailMerge.Execute False                                        ' run the MailMerge based on the above settings (i.e. for one record)
        Set singleDoc = ActiveDocument                                           ' Identify the ActiveDocument (foremost doc after running the MailMerge) as "singleDoc"
        singleDoc.SaveAs2 _
            FileName:=masterDoc.MailMerge.DataSource.DataFields("DocFolderPath").Value &amp; Application.PathSeparator &amp; _
                masterDoc.MailMerge.DataSource.DataFields("DocFileName").Value &amp; ".docx", _
            FileFormat:=wdFormatXMLDocument                                      ' Save "singleDoc" as a word docx with the details provided in the DocFolderPath and DocFileName fields in the MailMerge data
        singleDoc.ExportAsFixedFormat _
            OutputFileName:=masterDoc.MailMerge.DataSource.DataFields("PdfFolderPath").Value &amp; Application.PathSeparator &amp; _
                masterDoc.MailMerge.DataSource.DataFields("PdfFileName").Value &amp; ".pdf", _
            ExportFormat:=wdExportFormatPDF                                      ' Export "singleDoc" as a PDF with the details provided in the PdfFolderPath and PdfFileName fields in the MailMerge data
        singleDoc.Close False                                                    ' Close "singleDoc", the variable "singleDoc" can now be used for the next record when created
        If masterDoc.MailMerge.DataSource.ActiveRecord &gt;= lastRecordNum Then     ' test if we have just created a document for the last record
            lastRecordNum = 0                                                    ' if so we set lastRecordNum to zero to indicate that the loop should end
        Else
            masterDoc.MailMerge.DataSource.ActiveRecord = wdNextRecord           ' otherwise go to the next active record
        End If

    Loop                                                                         ' loop back to the Do start
End Sub                                                                          ' Mark the end of the Subroutine
</code></pre>
<p dir="auto"><strong>שלב ה וסיום:</strong><br />
סגרו את עורך הקוד.<br />
לחצו על כפתור פקודות מאקרו שבכרטיסיית מפתחים, בחרו את המאקרו בשם <strong>MailMergeToPdfBasic</strong> ולחצו הפעל מצו"ב צילום מסך<br />
<img src="/assets/uploads/files/1662883849719-3890ce69-c0e9-4f30-89ce-3e97b7de750b-image.png" alt="3890ce69-c0e9-4f30-89ce-3e97b7de750b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">כעת שבו בנחת והמתינו עד ליצירת כל הקבצים, להנאתכם תפתחו את תיקיות הפלט שיצרתם וגלו שהיא מלאה קבצים קובץ לכל רשומה בשם המתאים שהגדרתם לה.</p>
<p dir="auto"><a href="https://imnoss.com/word-mail-merge-to-separate-pdfs/" target="_blank" rel="noopener noreferrer nofollow ugc">מקור</a></p>
]]></description><link>https://tchumim.com/topic/13973/מיזוג-דואר-שמירת-קובץ-pdf-נפרד-לכל-רשומה</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 10:05:39 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/13973.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Sep 2022 08:12:04 GMT</pubDate><ttl>60</ttl></channel></rss>