Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge prob: "previous" record needed on second page 2

Status
Not open for further replies.

Fenrirshowl

Technical User
Apr 29, 2003
357
GB
Hi Guys

I have a mailmerge problem. Effectively I have two pages to the document, which are two different (but related) forms, containing data related to a set of individuals. The first contains the data we hold, the second is to be returned to us with data the recipient holds. There are 4 records per page/form.

I've set up the mail merge and used "next record" to populate the 4 entires on the first page and then want to partially populate the second (i.e. inputting some of the same data as is on the first sheet - for instance the names of the individuals).

Using the same fields as the first page and using "next record" again, I don't get the result I need as the current record does not reset. Is there any way to select the "previous record" in a similar way to "next record" or to reset the current to the current value minus 4?

To illustrate:
If the names of the individuals are denoted A-Z and I require 4 per page (repeated on pages 1 and 2) I would require

A, B, C, D and A, B, C, D

but I get

A, B, C, D and D, E, F, G

The fields used are {name}, {Next record}{name} x3, then {name}, {Next record}{name} x3 again on the second page.

Anyone have any ideas?

The only solution I can see is to split the pages and produce 2 merge documents. Given we could have several hundred sets of forms I wish to avoid the need to pair up sheets after printing if possible.

Thanks in advance

Fen
 
In a mailmerge you provide a skeleton for a single source record and then reproduce populated copies of it per record. There is no way to say you want to weave the resulting copies together - which is what you're asking.

The four individuals in your example effectively constitute a single 'logical' data record and the way to get what you ask is to change the data source so that the data are presented in that way. You don't say what format the source is in but if it is a table in a database you should build a query on top of it and use that as the source.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Hi Tony

Thanks for the response.

The backing data is in Excel - a simple contiguous table, one row of data per person. As basic as you can get.

If I understand you correctly, the solution you suggest would be a query based on the data - which would have repeated data in record 5 equal to record 1, 13 equal to 9 etc. (equivalent to inserting 4 lines into the source data after every 4th record and making it equal to the entry 4 rows above)?

Fen
 
Well, that wasn't really what I meant but it would serve the same effect.

I do wonder if this could be rigged in Word but I can't think how at the moment; it is an unusual structure. What, if any, is the relationship between the customers in each group? And if there isn't any relationship, what is the purpose of mixing them up like this?

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
The purpose of the mailing is to use a (UK government department) letter forwarding service to make contact with past members of an organisation for whom we have no current address. Using certain personal details still held to identify them, the service will forward letters at a minimal cost asking the recipient to make contact with us.

There are several forms that need completing. The first form asks for the personal information to identify the individual together with the last known address, the second we pre-populate (Name, date of birth and NI number/Social Security number) and it is returned to us advising whether the person was located and a letter sent, couldn't be found, or has died (via an appropriate check box). The other forms we need to send are not relevant to the mailmerge problem.

Each form has space for 4 individuals only, so for a 500 member letter forwarding mailing we would need 250 sheets of paper (125 for each form).

We complete these tasks for a variety of organisations, mailings could run into several thousands at the top end (hence the reason to want to avoid 2 separate merges, 1 per form, to be manually matched together later).....and yes each form needs to be submitted with the other and the letters to the individuals to be forwarded (i.e. not as 2 separate stacks, presumably in case they get shuffled).

Currently the forms cannot be submitted electronically, so we are looking at a mail merge or good old pen & paper.

Once again, thanks in advance.
 
Ah! Dealing with a government department explains it all. They are the only organisation I have ever come across that had a Forms Design Department - and they are the worst designers of forms I have ever come across.

Thinking about it, duplicating the Excel rows won't work. The repeating unit of the merge (what must effectively be a single source record) is two pages.

If you are automating the entire process I think I would do two merges and then write some VBA code to combine them - with a loop going through the two documents in parallel, picking up corresponding Pages and printing first one then the other. If you actually need the documents themselves combining, a similar process could work.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Pity VBA in Word isn't a strength of mine - Excel is fine, but Word is highly restricted.

I'd think repeated records would work. If I created repeated batches of 4 and ran the two forms using "next record" over 8 records at a time, it should be ok. There would be "worthless" duplication of data in the excel file to make it work, but I think it would be ok.

The files would be
A
B
C
D
A
B
C
D
E
F
G
H
E
F
.....
etc.

Cheers Tony
 
OK - I'm not a mail merge expert but I just had a quick play and you seem to be right.

I can let you have some basic vba to print doc1page1 doc2page1 doc1page2 doc2page2 etc if you want

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Tony

Apologies, for some reason I didn't get the email notification for your last post.

Word VBA would be great - many thanks

Fen
 
Basic code is:
Code:
[blue]    Set Doc1 = Documents("Document1") ' Put your own document ..
    Set Doc2 = Documents("Document2") '  .. paths and names here
    For Pg = 1 To Doc1.Content.Information(wdNumberOfPagesInDocument)
        Doc1.PrintOut Range:=wdPrintRangeOfPages, Pages:="p" & Pg
        Doc2.PrintOut Range:=wdPrintRangeOfPages, Pages:="p" & Pg
    Next[/blue]
Note that this will create one print job for each page so if you are sharing a printer or have cover pages added you may need to consider doing it differently.
This also isn't clever - it assumes both documents have the same number of pages.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top