Reply
 
Thread Tools Display Modes
  #1   Report Post  
Believr
 
Posts: n/a
Default mail merge phantom records

At my company we have to complete a form listing borrower documentation for
each loan they have with us. I have made a mail merge document in Word 2003
using the info I enter into an Excel 2003 spreadsheet. It has been working
great until I came up to one person that had 4 loans instead of 1 or 2. I am
getting a glitch where every merged form after the one with four records also
has the same loan 3 and 4 information as the original. If I just merge the
later forms separately, this phantom information does not show up. Any
ideas?
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

This sounds like a multiple items per condition situation.
Word does not really have the ability to perform a "multiple items per
condition (=key field)" mailmerge.

See the "Multiple items per condition" item under the "Special merges"
section of fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm

Or, if you create a Catalog (on in Word XP and later, it's called Directory)
type mailmerge main document with the mergefields in the cells of a one row
table in the mailmerge main document with the keyfield in the first cell in
the row and then execute that merge to a new document and then run the
following macro, it will create separate tables with the records for each
key field in them. With a bit of further development, you may be able to
get it to do what you want.

' Macro to create multiple items per condition in separate tables from a
directory type mailmerge

Dim source As Document, target As Document, scat As Range, tcat As Range
Dim data As Range, stab As Table, ttab As Table
Dim i As Long, j As Long, k As Long, n As Long
Set source = ActiveDocument
Set target = Documents.Add
Set stab = source.Tables(1)
k = stab.Columns.Count
Set ttab = target.Tables.Add(Range:=Selection.Range, numrows:=1,
numcolumns:=k - 1)
Set scat = stab.Cell(1, 1).Range
scat.End = scat.End - 1
ttab.Cell(1, 1).Range = scat
j = ttab.Rows.Count
For i = 1 To stab.Rows.Count
Set tcat = ttab.Cell(j, 1).Range
tcat.End = tcat.End - 1
Set scat = stab.Cell(i, 1).Range
scat.End = scat.End - 1
If scat tcat Then
ttab.Rows.Add
j = ttab.Rows.Count
ttab.Cell(j, 1).Range = scat
ttab.Cell(j, 1).Range.Paragraphs(1).PageBreakBefore = True
ttab.Rows.Add
ttab.Cell(j + 1, 1).Range.Paragraphs(1).PageBreakBefore = False
For n = 2 To k
Set data = stab.Cell(i, n).Range
data.End = data.End - 1
ttab.Cell(ttab.Rows.Count, n - 1).Range = data
Next n
Else
ttab.Rows.Add
For n = 2 To k
Set data = stab.Cell(i, n).Range
data.End = data.End - 1
ttab.Cell(ttab.Rows.Count, n - 1).Range = data
Next n
End If
Next i


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Believr" wrote in message
news
At my company we have to complete a form listing borrower documentation
for
each loan they have with us. I have made a mail merge document in Word
2003
using the info I enter into an Excel 2003 spreadsheet. It has been
working
great until I came up to one person that had 4 loans instead of 1 or 2. I
am
getting a glitch where every merged form after the one with four records
also
has the same loan 3 and 4 information as the original. If I just merge
the
later forms separately, this phantom information does not show up. Any
ideas?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Mail Merge Issue With Office 97 - Excel Data Source Matt Thorley Mailmerge 1 February 15th 05 11:38 PM
How to Mail merge records into a new/separate document Denise Mailmerge 1 February 1st 05 11:25 PM
How do I set up mail merge to include 2 separate sets of records . Northern California Mailmerge 1 January 13th 05 12:51 AM
How can I print the records I have entered in my mail merge datab. TeresaL Mailmerge 1 December 29th 04 09:13 PM


All times are GMT +1. The time now is 07:02 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"