h1

Word 2003: Create separate mail merge documents

June 15, 2009

The client from a week or so ago was very pleased with the mail merge document I had created for them. Then they asked if they could get separate documents for each mail merge instance and save them automatically, using the organization’s name in the file name. They are a government department and need to keep separate records of each funding request, which was the purpose of the mail merge document in the first place. So this was not an unreasonable request. Should be easy, right?

What I thought would be a quick thing to do ended up taking a couple of hours of testing, searching, testing some more, followed by hair tearing. ;-) You’d think Microsoft would make this easy, but they don’t. In fact, it’s not something you can do from within the standard Word commands at all — you have to either add VBA to the Word document, purchase a separate application, or download a file someone else created that solves this problem. You’ve got to think that this would have been a common request for all the years that Word’s had a mail merge feature.

Anyhow, on to the solution, which is found here: http://www.gmayor.com/individual_merge_letters.htm

PLEASE NOTE: Graham Mayor's webpage was updated on 19 January 2012 (see his comment for this date below), so the rest of the information in this blog post MAY NOT be relevant. I haven't tested the new version. (Rhonda)

Problem: That webpage is a jumble of Word 2003 and 2007 options, troubleshooting options etc. It’s hard to get a clear picture of what you have to do to get it to work. So in the interests of making their steps nice and clear, here’s what you have to do in Word 2003 (I haven’t tested in Word 2007 yet — if I do, I’ll write a separate blog post for those steps).

Note:

  • These steps must be done on the computer of the person running the mail merge — it’s not something that can be incorporated into the master mail merge document, nor something that can be done on a server.
  • The mail merge document must already exist.

Download and install the Word add-in

  1. Close Word.
  2. Close Outlook. (Check Task Manager to make sure there are no running winword.exe and outlook.exe processes — kill them if there are.)
  3. Go to: http://www.gmayor.com/individual_merge_letters.htm
  4. In the first paragraph after the PayPal Donate button, click the link to Word Add-in-template and download it to the local machine. It’s a zip file called MMtoDocs.zip.
  5. Unzip and extract the contents from the zip file. You’ll get two folders — one for Word 2002-3 and one for Word 2007.
  6. Open the Word 2002-3 folder and copy the MMtoDocsRev37(Word 2003).dot file — it’s the only one in there. (Note: This post was written in May 2009, so the Rev number may be different for your download.)
  7. Open Windows Explorer if you’re not already in there.
  8. In the Address bar, type %appdata%\Microsoft\Word\STARTUP then press Enter. This takes you straight to the STARTUP folder.
  9. Copy the MMtoDocsRev37(Word 2003).dot file into the STARTUP folder.

Create the mail merge split template

  1. Open your mail merge document.
  2. You’ll see a new Word toolbar button called Create Template for the Merge Document (it may be floating) — click it.
  3. You’ll get a warning message that the template will overwrite any other template of the same name. (BTW, the template name is SplitMerge.dot, but you shouldn’t have another one with that name in your Templates folder if this is the first time you’ve done this.) Click OK.
  4. A new document that looks just like your mail merge document is created, called SplitMerge.doc (the title bar shows the new name). Your original mail merge document is not touched.

Run the mail merge

  1. While you’re in SplitMerge.doc, run the mail merge as normal by clicking the Merge to New Document icon in the Mail Merge toolbar.
  2. You’re asked which records you want to merge. Make your selection and click OK.
  3. Now you’ll get asked some new things — first, whether you want to create a separate doc for each record. You do, so click Yes.
  4. Next, you’re asked which of the mail merge fields you want to use for each document’s file name. Select a field — for my client, I chose the organization name field.
  5. Leave both check boxes as they are (the first one is checked, the second isn’t).
  6. Click Browse. Navigate to, then select the folder where you want to save all the separate mail merge documents.
  7. Click Continue.
  8. All your individual files for the record range you selected are created one by one, and each gets the file name of the mail merge field you selected at step 5.

And that’s it! Very clever!

If you get errors, check the original webpage (http://www.gmayor.com/individual_merge_letters.htm) for the likely cause and solution.

And if this has just saved you a heap of time, consider making a donation via PayPal on that website to Graham Mayor, the guy who developed this solution and made it available for free.

66 comments

  1. Wo this is amazing. Thank you soooooooo much!


  2. Thanks for this! It was wonderful once I got it working, but it took me hours to get it working because of one little thing I forgot to do. To save everyone else pain and suffering, I’ll add the extra tip here:

    If you’re using Word as your email editor, then you have to not only CLOSE WORD in step 1, but CLOSE OUTLOOK. Then, just to make sure that all instances of Word are closed:

    Click CTRL + ALT + DLT,
    Click “Task Manager”,
    Click “Processes”
    Click the “Image Name” column to put them in alphabetical order
    Click “WINWORD.EXE” if it appears
    Click the “END PROCESS” button
    Click “OK”
    *If “WINWORD.EXE” appears more than once, click ALL instances and END PROCESS

    All of the above is included in the “Close Word” step in the instructions. When you’re done with this, proceed to the next steps.

    The above only has to be done once :)


  3. Thanks Katryna. Because I wasn’t using any fields from my Outlook Contacts, I wasn’t aware that Outlook should be closed too. I’ll add that to the steps above.


  4. Thank You, Thank You, Thank You –

    Until now this has been a huge nightmare when creating 100 + unique agreements of 30 pages in length !

    I am going to donate Graham right now !!

    Amazing !


  5. This has to be the most useful tool out there !

    I had come across this tool before but was unable to use it because of the instructions on the website.

    This set of instructions has made it so easy to do thank you soo much xxx

    also the ability to convert to separate/split pdf files is wonderful!.

    Thank you for taking the time to provide instructions that the not I.T. clued up people can follow.


  6. Worked awesome. I selected 2007 and it worked in WORD 2007. I have to create both .doc and .pdf and it created both when running just once.


  7. thanks a bunch for this! hassle free! I used the 2007 version.


  8. Hi

    Great tool. I have a question though. When running the merge and selecting the contacts, if the contacts are in a list and for example every other one is selected (say, number 1 is select, 2 isn’t, 3 is selected etc etc) then the split merge doesn’t work. Does anyone know how to get this to ignore the unselected contacts and cintinue to work?

    Thanks in advance for your help.


  9. I have a picture (pic of signature) that is in the mail merge document. I get an error in each of the separated documents where the signature should be:

    Error! Objects cannot be created from editing field codes.

    Anyone know what to do???


  10. Works well, but the only glitch is that all the resulting files are in “Normal” layout, even though the master file is in “Print” layout (which is what I need). Any idea how to remedy that?


  11. Have a look at this resource for adding a macro that changes the layout to Print: http://www.theofficeexperts.com/forum/archive/index.php/t-938.html (I haven’t tried it, so can’t tell you whether it works or not)

    Also, search the internet for wdprintview, which seems to be the critical thing to change it to..


  12. This solution used to work every time and I was starting to get quite attached to it, but for some reason I now can’t get it to run at all. I can get as far as creating SplitMerge.doc and everything looks fine, but now when I click “Split the Merge”, Word now merges into a single document and doesn’t ask me if I want to create a a separate document for each record, etc. I’m not sure what I’m doing differently, but any pointers would be gratefully received! Thanks, Richard.


  13. Hi Richard

    If you’re getting errors or it’s not working properly, I suggest you check the original webpage (http://www.gmayor.com/individual_merge_letters.htm) for the likely cause and solution.

    –Rhonda


  14. Hi Rhonda,

    I spent a few hours grappling with it yesterday, and I think it’s a problem with the merge template I’m using. I made a little test merge template and the tool works fine, but when I re-create my proper template from scratch and manually re-insert all the merge fields (20 of them) it doesn’t work any more.

    I’ll keep looking, and I’ll post here if I ever figure out the problem.

    Richard.


  15. This is a great add-in! It gave me my word documents, but everytime I clicked the “Do you want to create PDF Files”, I get a Visual Basic error:” Run-time error ‘-2147467259 (80004005)’:This file is read-only.” I don’t have the PDF plug-in, but I do have Acrobat Professional 8 (which may be the culprit).


  16. This is perfect! Microsoft really should build this into Word, it doesn’t make sense not too. Thank you!


  17. I run into a problem when trying to run the macro.
    it does create the first document and then gives an Run-time error ’5904′: Cannot edit Range.
    I am not sure why and have tried a sample (and simple) merge but still getting the same error.
    the macro code is locked too so I can’t see why it’s breaking and there is no reference to this on gmayor’s page.
    any help is greatly appreciated as I desperately need this tool.


  18. Richard,
    I have the same problem, did you ever manage to solve it?
    Thanks,
    Sanne


  19. Some interesting comments on my web page, but I must correct the assertion by Pasha that the code is locked. The macro code is not locked. It is freely editable if you open the template in Word. Only one person has commented (to me) that there has been a run time error 5904, but I have yet to ascertain in which version. Both versions have been updated since the last posts here.

    Most problems relate to the merge documents themselves. Before reporting problems, ensure that you have used the create template option first.


  20. I have had the run time error 5904 as well. I’m running the Word 2003 version.

    It ran okay on one machine, but not on another.


  21. Before proceeding further close Word and Outlook and ensure that you have no orphan temporary files – http://www.gmayor.com/what_to_do_when_word_crashes.htm – and do you have any other add-ins installed that may conflict. Can you temporarily disable them from tools > templates and add-ins.

    Development on the 2003 version of the add-in has finished. I will however continue to bug fix as problems come along and I would certainly be interested in trying to resolve this problem.

    So far one user has sent me document and data that claimed to demonstrate the issue, and they merged perfectly. Unless I can reproduce it, it will be difficult to fix it :(


  22. Hi Graham

    Thank you SO much for checking out some of the issues posted here.

    –Rhonda


  23. I have tried the instructions on the site and these instructions but keep coming up with hangups.

    I’m using Word 2007.

    When I get to the part where you create the “template for the merge document”; does that mean click the “Create Merge Template” button? When I do that it says:

    “The documjent you are attempting to process i9s not a letter merge document. Open an existing letter merge documenta nd if necessary run this function again. If you now create a new document, this function probably won’t be required, as the split function will use the template from which the merge document was created.”

    Does that mean I should re-save my document to be a template before I hit this?

    Thanks soooo much for all your help. I more than appreciate all of the work that goes into these kidns of things.


  24. Must say this is one of the best macros. Well done!!!


  25. this is awesome!! Thanks, but i would like to edit the macro and when I try to edit it, it prompts me for a password. I’m using the Word2007 version. Please advise..


  26. My guess is that you (or someone in your organization) have assigned a password to the macro as I don’t believe the macro itself, as written by me or the originator (Graham Mayor), has a password associated with it. You can check Graham’s original post (http://www.gmayor.com/individual_merge_letters.htm) and other comments here — no-one has reported anything to do with a password.

    If you’re working for an organization that locks down functionality, you may find that they have set up Word so that you can’t edit macros without a password.

    –Rhonda


  27. The latest revisions of the add-in are password protected against viewing the macro code. This is a deliberate ploy as some users were selling on the add-in as their own work. If you have a problem with the add-in you can contact me via my web site, from where the add-in was downloaded, however do read the associated web page first, as most of the potential issues are covered in the notes there.


  28. Thanks for that information Graham. That should answer Sherri’s question.

    –Rhonda


  29. I think I have the same problem as Chelsea Robertson above. It doesn’t seem like she received a response. I am running Word 2007. The ‘Create Merge Template’ button is highlighted, and when I click on it, it gives me this error:

    “The document you are attempting to process is not a letter merge document. Open an existing letter merge document and if necessary run this function again.

    If you now create a new document, this function probably won’t be required, as the split function will use the template from which the merge document was created.”

    Additionally, I cannot click the ‘Split the Merge’ button; it is greyed out. I am not sure why.

    I appreciate any insight you can give me.

    Sean


  30. The Create Merge Template function is only necessary of the format of the split documents does not match the merge document. That function is only available to a letter merge document.

    The Split the Merge button is only available to mail merge documents. i.e. the document you are using to create the merge with the data source attached.

    Incidentally I have recently updated the zip file to include an optional installer.


  31. This works very well for me when the master document is a single page, but not with a three-page document that I use. For the latter, the tabs and margins on the second and third pages go haywire after the merge. Any ideas on what the problem could be? Thank you.


  32. No idea – but if you want to send me a copy of the merge document and some dummy data to the link on my web site, I will take a look at it.


  33. I successfully got individual letters created from my original merge document…however the formatting was changed in the process. Being that each of these 12 page letters contains numerous tables and precise formatting, my individual letters are no good :( any idea why this happened or know of a way to fix it if I try again? Thanks!


  34. Need Help!

    I am going through what I believe are the correct steps and still, each time I click “Split the Merge” it only spits on the first record.

    Steps:
    1. I start with a Normal.doc template file. I then insert my data fields to be pulled from the CRM. I then save the file as .XML so that I can load it into the CRM.
    2. Load file into CRM, go through mail merge steps to where I can preview each of the recipients.
    3. Click “Create Template for Merge Document” – this creates the .dot file in my Templates folder and creates a SplitMerge.doc file.
    4. Re-save the SplitMerge.doc as SplitMerge.xml and re-upload this into the CRM in place of my current template.
    5. Close Word and Outlook. Then open the SplitMerge.dot file, then reopen Outlook.
    5. Go through the CRM mail-merge steps and then click “Split the Merge” — only 1 file comes out.

    Any thoughts on whats causing this? Really could use some help!


  35. Hi Bradley

    There are too many factors in here that could be causing this to break. I’d suggest you test it JUST in Word first before saving as XML, loading into CRM, etc. and see if that works.

    I’m not a mail merge expert at all, so that’s about all I can suggest at this stage.

    –Rhonda


  36. Rhonda,
    How do I link the document back to my CRM database that I want to mail merge from?
    Thank you -
    Brad


  37. Hi Brad

    Perhaps set up a test Excel spreadsheet with some sample data and try that. Or perhaps use the CRM database to generate the letters as you’re doing now, but take the XML stuff out of the equation first. You need to prove that the mail merge split works first, then you need to try to make it work with your environment.

    Anyone else got any ideas to help Brad??

    –Rhonda


  38. This is amazing, thank you! If in Word 2003, make sure that the spreadsheet is also in 2003 format too, not a later version! That solved my problems!


  39. I love this app, but after the first day, I tried to use it again and it just merges them all into one document, never getting to the screen where you designate the filename. Help?


  40. All the usual causes for the add-in not to work are covered at the start of the web page http://www.gmayor.com/individual_merge_letters.htm. Note that if the add-in fails to split the merge, it will not do so again until Word is restarted (in the case of Word 2003, this also means closing Outlook)


  41. I shut down Word, but it didn’t help. Then I restarted my computer and tried it again. That time, it worked. Question: If I create a new merge document and use the SplitMerge macro on it, where will it save the SplitMerge template? Will it overwrite the first template I made? Will I then have to start over with the first merge document the next time I use it? OR is it the same thing no matter which merge document I use?


  42. The add-in does not affect your original merge document template. If you use the optional module to create a template, It creates a working template in the User Templates folder. This template is over-written next time you use the function. You only need to use the Create Template function if the merge adversely affects the formatting in your original merge document. In that respect it is a two stage process. Create or open your merge document then run the create template before splitting the merge.


  43. when I create template for merge document I get the warning message, I press ok then I get run time error 4120 bad parameter, what does this mean


  44. Wonderful tool only thing I have encountered is that it changes the formatting on the merged document is there a way around this


  45. Use the function to create a template before splitting the merge.
    Format your document with styles as Microsoft intended.


  46. Hi All,

    I am very excited about getting this to work and I’m a little envious of those of you who have been successful

    I also get the same error as a couple of people in the thread above. When I try to run the app (with the new “Split the merge” button), it gives me the dialogue boxes as described on Graham’s website – I choose the “Name” field in order to name each of the new documents and give it a path for them to be saved to. However,, when I hit “Continue”, it starts to work, but then gives me a Run-time error ’5904′: Cannot edit range.

    Did anyone successfully resolve this problem?

    Thanks,

    Mike Dickinson


  47. This error is usually caused by a conflict with other add-ins. MathType is one such add-in that is reported to cause this problem.


  48. If anyone is still following this thread, please note that I have redeveloped this application from scratch, with the aims of making it more reliable and when it does fall over to do so more gracefully.

    Features have been added – and the 2003 version now more closely matches the 2007/2010 versions.

    The new versions (for Word 2002/3, 2007 and 2010) are now available from http://www.gmayor.com/individual_merge_letters.htm


  49. Thanks so much for letting us know, Graham. I’ll add this info as an update to the post.

    –Rhonda


  50. Very brilliant tool done where would we be without talented dedicated developers. Worked perfectly on PC at home However I had to travel long distance for death in family so grabbed my laptop and did the same but got one problem just not giving me the choice to choose a range of records.Now it just gives me all the hundreds of letters again and files for empty records below as there are some common fields already filled up for time saving purposes. Records file is a basic spreadsheet. word 2003 and win xp sp3 exactly the same as pc at home .
    Please can somebody help.Any help will save my bacon.
    Thanks.

    Warmest Regards.

    Dilip Dabrai


  51. Are you using the newly revised version from the web site? This has been redeveloped to attempt to eliminate such problems and does not wok in the same way as the earluer version. You must use the command on the toolbar as it no longer intercepts the merge to a new document command.


  52. For some reason I can’t get this to work for me, I have now tried it on two different computers, XP with Office 2007 and a Win 7 pc with Pffice 2010, in both cases it just creates the first document (processes 1st record in data) and then stops, but doesnt show an error,,,what am I doing wrong?


  53. It is impossible to say what you are doing wrong as you have not provided sufficient information to hazard a guess. Take a look at the notes at the start of the web page.

    If you wish to provide more information, contact me via my web site.


  54. Do you know if the 2003 works on 2000? Every time I press “split the merge” I get an error message saying Compile error in hidden module: ModMain


  55. Hi Annashen

    I have no idea as it’s many years since I used Word 2000. It definitely worked in Word 2003 as that’s where I did my testing. Graham Mayor, the author of this utility, may be able to answer your question.

    –Rhonda


  56. The add-in does not work with Word 2000. Microsoft changed the way mail merge worked in Word 2002 (Office XP). There is a macro at the end of my web page http://www.gmayor.com/individual_merge_letters.htm that will work in Word 2000, but it is nowhere near as sophisticated as the add-in.


  57. After spending a whole afternoon with this macro. I have had the same problem as many others:

    I follow the steps above, but i only have the first record split.

    I fixed this issue by creating my source list in Excel (originally in word)

    and selected the Main document type as ‘Letters’ then followed the steps and finally it created 122 individual documents with unique names from my source list as requested!

    1 question, as i am dyslexic, (in step by step way) how do i get it so that each new doc is saved with part from source list and part fixed detail.

    e.g. XXX – Trainee IT Policy Training Form Update v1.1 30 04 12

    (where ‘XXX’ is this is from the source list and the rest is static and needs to be the same for each record)

    hope this makes any sense

    Brilliant addon!


  58. The macro as offered does not allow the addition of fixed text in the file name.

    One possibility would be to add another column to your worksheet containing both the name and the additional text and use that as the field to name the document.
    OR
    I could modify the add-in to include fixed text, but there would be a charge involved for the work involved in doing that. If you wish to explore that contact me via my web site.


  59. :( I can only get it to do one document at a time. This makes me sad. What am I missing?


  60. haha! I figured it out! I am brain dead! I forgot the <> field! Duh! Thank you soooo much for this program!! You saved my life! I just created 657 separate documents! I LOVE YOU!!!


  61. I forgot the Next document field that is.. :)


  62. Before I go on to my problem, I want to state that I am using a CSV file to do this merge. I had to use the {next} field at the end of my template in order for the program to even attempt to see the next record. Otherwise, it just creates the first template with record #1 and stops.

    To be clear, I tested this using a standard Excel file and it worked seamlessly. Unfortunately, I have over 256 columns in my data source so CSV is my only option (at my tech level).

    I am somewhat at my wits end here; I FEEL that this thing is going to work for me but I keep getting: “There has been an uncorrected error number: 5941. This error pops up when the template is opened with the data from the first record. No other templates are loaded with the subsequent records, only the first.

    It’s telling me to make sure no other instance of WinWord is running. Could this be popping up because the SplitMerge document IS open while the first merge is opened?

    Any thoughts on this? Need more information?

    Thank you!


  63. I just tried version 2.5 and was able to download the version and create the documents within 15 minutes. Love that it creates Word or PDF versions.


  64. I was also searching a solution to create multiple word documents during mail merge and i have C# and VB.NET code from this .NET Library and it was a relief for me and they have many more code examples in c# and .net


  65. For the benefit of anyone still following this thread, version 3.0 includes some useful enhancements and http://www.gmayor.com/ManyToOne.htm provides similar functionality AND allows the creation of many to one merges and much more.


  66. Thanks Graham!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 298 other followers

%d bloggers like this: