Solved

Mail Merge Template - last record in datasource?

Posted on 2001-07-23
5
248 Views
Last Modified: 2011-10-03
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
Comment
Question by:lurch36
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Dreamboat
ID: 6312274
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
 

Author Comment

by:lurch36
ID: 6315414
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
 
LVL 22

Accepted Solution

by:
Dreamboat earned 150 total points
ID: 6317096
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
 

Author Comment

by:lurch36
ID: 6320184
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
 
LVL 22

Expert Comment

by:Dreamboat
ID: 6320220
Why, thank you, sir!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now