Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MAIL MERGE
I need to produce a directory/catalog and when the unique ID Number changes
the next set of records should print on a new page. Can someone direct me to a page that will help me. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MAIL MERGE
How to use mail merge to create a list sorted by category in Word 2002 -
http://support.microsoft.com/?kbid=294686 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jude2302 wrote: I need to produce a directory/catalog and when the unique ID Number changes the next set of records should print on a new page. Can someone direct me to a page that will help me. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MAIL MERGE
If you have the ID Number in the first cell in the one row table in the
directory mail merge main document 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 ID Number in them. ' 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 "Jude2302" wrote in message ... I need to produce a directory/catalog and when the unique ID Number changes the next set of records should print on a new page. Can someone direct me to a page that will help me. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail-Merge: Can we have master detail relationship or multiple entities in word Mail-Merge? | Microsoft Word Help | |||
Take Mail Merge in Word back the the Mail Merge Helper 1,2,3 Form. | Mailmerge | |||
collate pages in mail merge vs mail merge being single document | Mailmerge | |||
Proteced Form with Mail Merge Section-Mail Merge is "lost" whe | Microsoft Word Help | |||
mail merge doc with further linked/embedded mail merge docs not playing the game | Mailmerge |