Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Sounds like you are trying to perform a "multiple items per condition (=key
field)" mailmerge which Word does not really have the ability to do: See the "Group Multiple items for a single condition" item on fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 http://www.knowhow.com/Guides/Compou...poundMerge.htm As a thought however be able to use an area at the end of the document where you insert your "receiver variables" and the next record fields. (it has to be at the end as once you use a next record field in a document, there is no going back to a previous record for more data. Then, if you were to bookmark those receiver variables, you may be able to overcome the fact that the bookmarks are destroyed by the mailmerge process by using the following macro to reinstate them. Then in the header you may be able to use a cross reference to the text of the bookmarks. ' Throwaway Macro created by Doug Robbins to "preserve" bookmarks during a MailMerge ' Dim abm As Bookmark, bmrange As Range, i As Long, Result As Document, j As Long, k As Long, linkrange As Range, linktarget As String Dim Source As Document Set Source = ActiveDocument i = 1 For j = 1 To Source.MailMerge.DataSource.RecordCount For Each abm In ActiveDocument.Range.Bookmarks System.PrivateProfileString("c:\bookmarks.txt", "bookmarkNames", "bookmark" & i) = abm.Name & Format(j) i = i + 1 Next Next j For Each abm In ActiveDocument.Range.Bookmarks abm.Range.InsertBefore "#" abm.Range.InsertAfter "#" Next With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .Execute End With Set Result = ActiveDocument k = 1 Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(FindText:="#*#", MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True Set bmrange = Selection.Range bmrange.Characters(bmrange.Characters.Count).Delet e bmrange.Characters(1).Delete Result.Bookmarks.Add System.PrivateProfileString("c:\bookmarks.txt", "bookmarkNames", "bookmark" & k), bmrange k = k + 1 Loop End With For i = 1 To Result.Hyperlinks.Count linktarget = Result.Hyperlinks(i).SubAddress Set linkrange = Result.Hyperlinks(i).Range linkrange.Select linktarget = linktarget & Format(Selection.Information(wdActiveEndSectionNum ber)) Result.Hyperlinks.Add Result.Hyperlinks(i).Range, "", linktarget Next i Source.Activate Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(FindText:="#*#", MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True Set bmrange = Selection.Range bmrange.Characters(bmrange.Characters.Count).Delet e bmrange.Characters(1).Delete Loop End With -- 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 "KSPat" wrote in message oups.com... We have a very large Oracle database as our case management system. This database uses Word XP to create word merge legal documents. Each of these documents has a "copy list" that shows who it has to be mailed to. To do that "receiver variables" were created. These variables consist of the party's name, party type (attorney for mother, attorney for father, etc.), the address, etc. Some cases have three parties, some have as many as ten. In order to have everyone on the copy list related to the case, the receiver variables place holders are copied 10 times, with "NextRecord" prefacing the variable block on the 2nd to 10th record. To tell the database what party types should appear on the copy list, a control form is completed for each document. Now, the problem. 10 paragraph variable place holders - if there are less than 10 party types on a case, Word thinks its done and stops merging. This means the page headers don't merge. If I have only 3 parties, and three variable place holders, Work merges the header. If I move the receiver variables farther up into the letter, nothing after the variables in the body of the document will merge if there are more place holders than parties. Any way to fix this? Thanks Pat |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mail Merge Word 2003 Issue | Mailmerge | |||
mail merge incorrect page lengths with custom page size | Mailmerge | |||
30 page mail merge labels only prints one page? | Mailmerge | |||
Header & Footer not on first page but on subsequent pages | Microsoft Word Help | |||
How do I print 1st page letterhead 2nd plain in Word mail merge | Mailmerge |