• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Mail Merge Template - last record in datasource?

There may be another way around this, so I'll explain my dilemma before jumping into the question...

I'm trying to do a mail merge where I have some header information, some detail information and then a closing.  

This isn't exactly what I'm doing, but a simple example would be something like:
-------------------------------------------
Name: [Fred Bloggs]

Subject    Grade
[Physics]   [A]
[Chemistry] [A-]
[English]   [B+]

Well done [Fred], keep up the good work!
-------------------------------------------
...where the bits in [] are values from data fields (and we're only dealing with records for Fred Bloggs - no other students are involved, and the number of subjects is variable)

An MSDN search has suggested that I should be able to achieve this by setting it up as a Catalog merge type (to do the "Subject/Grade" detail part), and using {IF {MERGESEQ} = "1" ....} syntax in the template to do the header bit (from "Name:" through to the subject/grade table heading).

All of that works fine!
The trouble I have is trying to get the closing in - if it was just text, I could put it in the page footer or something I'm sure, but it uses a data field, and so I need to do it when I reach the last record - but how can I tell, within the template, that I have reached the last record of the datasource? (BTW - I'm using Office 97)
Or alternatively, how else could I get the closing in?
0
lurch36
Asked:
lurch36
  • 3
  • 2
1 Solution
 
DreamboatCommented:
Potential only: Try putting your closing into a table cell, or putting the grades part in one table cell and the closing in another.
0
 
lurch36Author Commented:
I tried that (both options), but it didn't work...
Using my simplistic example again, the effect that both of these have is as follows:
-------------------------------------------
Name: [Fred Bloggs]

Subject    Grade
[Physics]   [A]

Well done [Fred], keep up the good work!
[Chemistry] [A-]

Well done [Fred], keep up the good work!
[English]   [B+]

Well done [Fred], keep up the good work!
-------------------------------------------
0
 
DreamboatCommented:
See this site: http://www.mvps.org/word/FAQs/MailMerge/CreateAMailMerge.htm

I haven't done the catalog thing myself, but I've pointed others here and they've been pleased. I hope you are too.

I build my mailmerges myself, generally, when they're weird like this, so I'd really need to see your file and a sample of the data to work it out. (not good with the conceptual stuff I'm afraid!)

But you can email to techsupportgirl@home.com if you want.
0
 
lurch36Author Commented:
Thanks for your help Dreamboat.
It turned out that between the time I registered the question and read your answer, it was decided to do this one (and some others) in Crystal Reports instead of Word, so my question is no longer relevant.  However, I do have other Mail Merge things to do, and that web-site you pointed me to is quite good and comprehensive, so you can have the points and an "A" anyway!
0
 
DreamboatCommented:
Why, thank you, sir!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now