4

In Word 2007, I want to set up a mail-merge template where multiple rows from the data-source will appear on a single page. So, something like this:

---Page-Boundry--------

  Header blurb 1
  Header blurb 2
  Header blurb 2

  ---Mail-Merge-Repeating-Block--------

   <<Merge Field 1>>, <<Merge Field 2>>
   <<Merge Field 3>>

  ---End-Mail-Merge-Repeating-Block----

  Footer blurb 1
  Footer blurb 2
  Footer blurb 3

---Page-Boundry--------

Its the "Mail-Merge-Repeating-Block" bit that I'm stuck on. If I just set up a standard mail merge with the header blurb, the merge fields and the footer blurb I get one page per row, with each page showing one row in between the header and footer. What I need is one page of output with multiple rows in between the header and footer.

One side note: I'm configuring the merge fields manually, I'm not using the wizard because I don't have direct access to the data source. The template I'm setting up will be stored in a custom business application that actually does the merging.

3 Answers 3

3

You'll need a <<NextRecord>> field after each row of the data source EXCEPT THE LAST ONE ON THE PAGE.

If there is any way humanly possible to get that data source pre-processed to a temp file that has all of your data in one record it would help you a lot in the long term.

2
  • 1
    @d4nt Is it possible to add such field when using Excel worksheet as a data source? By "<>" you mean field name, or field contents (and name is irrelevant)? Nov 25, 2012 at 9:27
  • @AdamRyczkowski - fixed the answer, Dan was referring to the <<NextRecord>> rule.
    – Josh M.
    Jun 27, 2014 at 18:46
3

I've just seen this. Perhaps the product XpressDox would be something to look at. Although it might be overkill for just this one application. But if you have more like this, then it might be what you want. http://www.xpressdox.com (Disclosure: I am the developer of XpressDox).

The way I would recommend is that you use the Document per Repeated Item feature. You would approach it something like this:

Firstly, you would need to configure that data source in XpressDox. The web-site article Configure a data source gives step-by-step instructions on how to do this . In the code below I will assume that you have called the data source "MyDs", that the XpressDox name for the table is "Repeater" and that you have chosen the option that the entire data source is to be returned (i.e. not the option that the user must be able to choose a row).

Then (if you haven't already done it), type in the document (into Word), much as you have it in your example above.

Somewhere (anywhere, but probably at the top makes sense), put the XpressDox command:

«IncludeDataSourceData(MyDs)»

Where your example refers to the Merge Fields, replace the code in your example with:

«Repeater[$Number]/MergeField1», «Repeater[$Number]/MergeField2» «Repeater[$Number]/MergeField3»

Then save your document using the "Save Template" button in the XpressDox ribbon in Word, and then run the template. In the interview, leave the "Number" field empty, and then press OK. It should do what you want.

In practice, your column names will probably be something more useful than in the example. Bear in mind that the column names must conform to XML element naming rules, but otherwise they can be anything you want.

0

It is not possible to do this simply in Word.

There are two free utilities available that use macros to address this.

Both are template Add-Ins that go into the Word Startup Folder and add their functionality to the Word interface and both work in Word 2007 and later. Both take some learning but are worth learning.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .