convert mail merge documents to individual pdf docs

Anonymous
2013-07-29T14:37:50+00:00

I created a mail merge using Word 2010.  It is several documents combined into one large Word file with section breaks.  It is many pages long.

I need to convert it into individual pdf documents.  I have used the vba code bleow with pdf creator with some success.  I now need to do the same thing with E-Copy 5.3

Sub SplitMergeLetterToPrinter()

    Dim Letters As Long, Counter As Long

    Letters = ActiveDocument.Sections.Count

    'MsgBox "Sections counted = " & Letters

    Counter = 1

    While Counter < Letters

        ActiveDocument.PrintOut Background:=False, Range:=wdPrintFromTo, _

            From:="s" & Format(Counter), To:="s" & Format(Counter)

        Counter = Counter + 1

    Wend

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

43 answers

Sort by: Oldest
  1. Anonymous
    2016-01-28T21:00:43+00:00

    I started this thread three years ago.  I have used the macro countless times.  What I have noticed is there is always a missing document that is not converted to pdf.  It is usually the last one on in the word doc.   Anyone have any insight?

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.6K Reputation points MVP Volunteer Moderator
    2016-01-28T22:45:26+00:00

    Use the Merge to Individual Documents facility on my MergeTools Add-in.

    You can download the MergeTools – 20150422.dotm Add-in that I created from the following page of my One Drive:

    http://bit.ly/1hduSCB

    Do NOT open the MergeTools – 20150422.dotm file.(There are no user serviceable parts inside and it should NOT be used as the basis for creating your mail merge main document.) 

    The MergeTools – 20150422.dotm file needs to be saved in the Word Startup folder.  In Windows Vista and Windows 7, 8 or 8.1, and 10, the default location for that folder is

    C:\Users[User Name]\AppData\Roaming\Microsoft\Word\STARTUP

    If you do not see the AppData folder: -

    In Windows 7, - In Windows Explorer, click on the Organize drop down and then on Folder and search options and in the Folder Options dialog, go to the View tab and select the item "Show hidden files, folders, and drives".  While there, it is a good idea to uncheck the box for "Hide extensions for known file types".

    In Windows 8,  8.1 or 10, in the File Explorer, click on Options on the View tab of the ribbon and then on the View tab in the dialog that appears and select the item "Show hidden files, folders, and drives".  While there, it is a good idea to uncheck the box for "Hide extensions for known file types".

     When that has been done and Word is started\re-started, the tab shown below will be added to the Ribbon:

    The requirements for using the system are:

    1. The mail merge main document must be of the Letter type, though that does not mean that the output cannot be sent as an e-mail message.
    2. For the Many To One, Merge with Attachments and Merge to Individual Docs utilities, the data source may be either a table or query in an Access database, or in the form of an Excel worksheet and that worksheet must be the first sheet in the Excel workbook. If the data is on some other sheet, you can easily move that sheet so that it is the first sheet in the workbook by clicking on the sheet tab and dragging it to the left.  For the Chart Merge utility, download the Mail Merging with Charts document that is also on that page of my OneDrive for additional requirements of the data source for use with that utility
    3. For a data source in the form of an Excel worksheet, the field names must be in the first row of the worksheet and there must be a field name in all of the cells in that row that are within the range of columns that contain the data.
    4. For both types of data source, the field names must contain only alphanumeric characters (No @,#,$,%,&,(,), etc) and the field names must not start with a numeric character (0-9). The number of characters in the field names, including spaces, must not be more than 40.
    5. For a data source in the form of an Excel worksheet, the data must start in the second row of the worksheet and there should be no empty rows within the range of data that is to be processed.
    6. If there are multiple addressees in either the To or CC fields of the data source, the email addresses need to be separated by a semi-colon.

    NOTE: The MergeTools applications cannot handle “Compound” MergeFields such as the «AddressBlock» or «GreetingLine».  Instead of using those fields, you will need to insert the individual merge fields.

    You may also want to download:

    1. the Merging with Attachments document that is also on that page which explains how the system is used.  It is not actually necessary to have separate attachments as the facility can be used to send just the documents created by the merge itself as attachments, either as the body of the message itself or in the form of Word files or .pdf files.
    2. the Mail Merging with Charts document that is also on that page.  That document explains how you must set up the Excel Data Source and the Mail Merge Main document to be able to execute a merge with a Chart that is unique to each record in the data source.
    3. the Using the Many to One Facility document that describes how to use that facility.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-02-16T00:34:51+00:00

    Hi Doug,

    I generally use a Microsoft Excel via DDE connection to link to my external data source to maintain formatting for numbers in my Mail Merge. Is there a way to maintain the source formatting whilst using your "Merge to Individual Docs" tool?

    Was this answer helpful?

    0 comments No comments
  4. Paul Edstein 82,871 Reputation points Volunteer Moderator
    2016-02-16T02:14:00+00:00

    DDE is very old technology and, while it allows you to retain the formatting in the source, the same results can be achieved without it, using the default OLE DB provider. For the most part, all you need to do is to apply the appropriate switches to the mergefields. Furthermore, using the default OLE DB provider means you're not constrained to using the formats in the data source and can thereby allow you to have less fields there if the same data needs to be formatted in different ways for mailmerging.

    For advice on how to use the formatting switches, plus a macro for generating individual PDFs and/or documents, see the Mailmerge Tips and Tricks thread at:

    http://www.msofficeforums.com/mail-merge/21803-mailmerge-tips-tricks.html

    or:

    http://windowssecrets.com/forums/showthread.php/163017-Word-Mailmerge-Tips-amp-Tricks

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2016-02-16T12:10:43+00:00

    I work in the financial industry.  Our network is highly secured and I am not the admin.  It would take an act of a higher deity for the head of security and desktop applications to allow me to download something from an unapproved website.  I do not doubt your solution will work.  It is just not practical for me. 

    If there is a work around to correct the problem;  "...there is always a missing document that is not converted to pdf...."

    I would appreciate any technical support anyone can offer.

    Was this answer helpful?

    0 comments No comments