Share via

Printing multiple mailmerge documents with a single mailmerged cover letter

Anonymous
2013-09-27T01:13:16+00:00

I am using a Word document to mailmerge from an Excel 2007 spreadsheet

The Word document merges a single form and a covering letter per address

I do not know VBA or how to stop a blank cover letter being printed

What I need to do is print variable numbers of forms per address but only one covering letter per address

e.g.

formA 1

formA 2

cover letter A

form B 1

cover letter B

formC 1

formC 2

formC 3

cover letter C

A B C are unique addresses and 1 2 3 are also unique references

I am looking for a way to set a variable and check if the next record has the same reference if it does it prints another form 

if it does not match a cover letter is printed and the variable set to the new reference and a form printed 

  1. declare variable
  2. set variable to record and print form
  3. compare variable to record 2 if matching print form 2
  4. if not matching print cover letter
  5. set variable for record as per 2 and loop until all records are printed

An alternative would be to check for a flag in the Excel record and only print a cover letter if the flag is set

Could anyone advise the code , code structure or a workable method to do this please?

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

3 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-09-27T22:31:39+00:00

    I do not think that there is anything on Graham's site or in my Merge Tools - 20130627 Add-in that can be downloaded from

    https://skydrive.live.com/?cid=5AEDCB43615E886B&id=5AEDCB43615E886B%21566

    that will do precisely what you are after in one go.  However, I believe that it would be possible to achieve what you are after by splittin your document into the A3 forms and the covering letter and first merge the A3 forms to create documents which you would then use as attachments with the merge with attachments facility.

    Then you would modify the data source so that it contained a field or fields that contained the path and filenames of the forms to be attached to the covering letter, the merge of which would be performed by the Merge with Attachments facility. 

    Alternatively, for a fee, I could create a customized version for you that would do the whole thing in one go.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-09-27T22:06:27+00:00

    Thank you for the reply

    I have read Many to one and your Catalogue Mailmerge tutorial

    I first have to say this is my first time using coding in MS Office so I may have misunderstood but the tools appear to put multiple records on one page

    My mailmerge template is used to populate a pre printed double sided A3 sheet and a cover letter

    The Word document therefore has two A3 pages and one A4 page

    The mail merge set up is to populate merge fields in text boxes from an Excsl source file

    The source data has varying number of A3 forms per customer

    Instead of merging a form and a cover letter for each form I want to print all the A3 forms and only one cover letter for each customer after all of the customer's A3 forms have printed and them move on to the next customer

    The source file has a unique reference for each customer and second unique reference for each form

    Hope this helps to clarify

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-09-27T08:09:03+00:00

    This is a many to one mail merge - without knowing the nature of the 'forms' http://www.gmayor.com/ManyToOne.htm  should be able to handle it.

    If you want to cobble something together manually see http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip

    Was this answer helpful?

    0 comments No comments