Solved

Mail Merge Template - last record in datasource?

Posted on 2001-07-23
5
251 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

809 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