Closed Thread
Results 1 to 10 of 10

Mail Merge to create separate PDF documents

  1. #1
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    Mail Merge to create separate PDF documents

    I've been working on a way to use an excel sheet to auto-populate PDF documents. At first I tried to do this through a macro, but I wasn't that successful.

    Taking a tip from the person who responded, I've attempted to do a mail merge, however my knowledge of mail merges is extremely small. That said, I've managed to create something that just might fit the bill. The trouble is, when I 'Print' and then select the PDF as my printer, it prints all my documents in one package as opposed to individually saving each of them. Also, the 'merge to Adobe PDF' doesn't seem to work. What am I missing?

    I've also provided the example PDF.

    How do I format the word document (ex. make the salary amounts show as currency)?
    Attached Files Attached Files

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge to create separate PDF documents

    See Send Mailmerge Output to Individual Files in the Mailmerge Tips and Tricks thread at:
    http://www.msofficeforums.com/mail-m...ps-tricks.html
    or:
    http://windowssecrets.com/forums/sho...ips-amp-Tricks
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    Re: Mail Merge to create separate PDF documents

    Dude this cool! Thanks!

    I've edited the macro and it's almost perfect. I'm getting a run time error see attached. It doesn't seem to prevent the macro from working though...

    I've uploaded a pic of the error and a notepad of the macro, here's the macro below:

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 09-18-2017 at 05:39 PM. Reason: Please use code tags when posting code!

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge to create separate PDF documents

    I don't know why you'd be getting a runtime error and you don't indicate what the error message said or what code line was highlighted. You also haven't used the code tags, which makes it much harder than it need be to read the code.
    Last edited by macropod; 09-18-2017 at 04:21 PM.

  5. #5
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    Re: Mail Merge to create separate PDF documents

    My apologies, I thought I attached a screenshot.

    It's Run-Time error '5853':
    Invalid Parameter

    When I go to debug, the highlighted row is:
    .ActiveRecord = i

    When I mouse over that row it says:
    .ActiveRecord = i = False (I'm not sure if that helps).
    Attached Images Attached Images

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge to create separate PDF documents

    The code works fine when I test it with your sample document & data source from post #1. Perhaps your Office installation has a fault. Try repairing the Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair).

  7. #7
    Forum Contributor
    Join Date
    05-02-2017
    Location
    NoVa, United States
    MS-Off Ver
    Microsoft 365
    Posts
    154

    Re: Mail Merge to create separate PDF documents

    That seems to have worked, but now I have run into a new error. I saved a copy of the excel, plus the word document, in a folder on a shared drive.

    When my coworker goes to access it, she gets the expected 'Opening this document will run the following SQL command:"

    Then it requires her to find the linked data sheet. She finds it (it's in the same folder) and she gets this error:

    Error has occurred: Could not find installable ISAM


    We've searched online and tried some solutions, but they don't seem appropriate; example: One calls to go into the excel document, go to 'connections' and then adjust something there - but when I do, there is *nothing* in the connection screen.
    Attached Images Attached Images

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mail Merge to create separate PDF documents

    Try having your colleague repair her Office installation.

  9. #9
    Registered User
    Join Date
    12-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Mail Merge to create separate PDF documents

    Good afternoon,

    Firstly, apologies for posting on a very old thread. I am relatively new to VB and was hopign someone can help me. I am trying to split the document and have successfully managed to run the code linked above. However, I am getting the documents saved as 1,2 .....

    In my mail merge (word) file, I have a logo of the company, and the next line is the name of an Employee. Is it possible to tweak the code to use the employee name as file name as oppose to 1,2...?

    Thank you in advance.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Mail Merge to create separate PDF documents

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro - Word Mail Merge into separate documents as PDF's
    By tanjasimono in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2017, 08:51 PM
  2. [SOLVED] Documents created from mail merge won't print
    By mgs73 in forum Word Formatting & General
    Replies: 7
    Last Post: 02-28-2016, 08:05 PM
  3. Macro to split mail merge into separate documents (MAC)
    By baobei in forum Word Formatting & General
    Replies: 5
    Last Post: 10-22-2015, 07:06 PM
  4. Replies: 0
    Last Post: 09-11-2015, 09:11 AM
  5. Why must I keep reconnecting the spreadsheet for my mail merge documents?
    By reallawyer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-21-2014, 03:52 PM
  6. Mail merge - create seperate documents
    By manito2000 in forum Excel General
    Replies: 0
    Last Post: 08-03-2011, 03:06 PM
  7. how do I use mail merge in excel for word documents
    By Lisa J Duffy in forum Excel General
    Replies: 1
    Last Post: 08-04-2005, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1